mirror of
https://github.com/stryan/mumble-discord-bridge.git
synced 2024-11-16 20:15:40 -05:00
correct debug message and add timing
This commit is contained in:
parent
910eaa5954
commit
dcc3fd48b4
@ -59,6 +59,7 @@ func (dd *DiscordDuplex) discordSendPCM(ctx context.Context, wg *sync.WaitGroup,
|
|||||||
|
|
||||||
lastReady := true
|
lastReady := true
|
||||||
var readyTimeout *time.Timer
|
var readyTimeout *time.Timer
|
||||||
|
var speakingStart time.Time
|
||||||
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
|
||||||
@ -72,7 +73,8 @@ func (dd *DiscordDuplex) discordSendPCM(ctx context.Context, wg *sync.WaitGroup,
|
|||||||
<-ticker.C
|
<-ticker.C
|
||||||
if len(pcm) > 1 {
|
if len(pcm) > 1 {
|
||||||
if !streaming {
|
if !streaming {
|
||||||
log.Panicln("Debug: Discord start speaking")
|
log.Println("Debug: Discord start speaking")
|
||||||
|
speakingStart = time.Now()
|
||||||
dd.Bridge.DiscordVoice.Speaking(true)
|
dd.Bridge.DiscordVoice.Speaking(true)
|
||||||
streaming = true
|
streaming = true
|
||||||
}
|
}
|
||||||
@ -108,7 +110,7 @@ func (dd *DiscordDuplex) discordSendPCM(ctx context.Context, wg *sync.WaitGroup,
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
if streaming {
|
if streaming {
|
||||||
log.Panicln("Debug: Discord stop speaking")
|
log.Println("Debug: Discord stop speaking", time.Since(speakingStart).Milliseconds(), "ms")
|
||||||
dd.Bridge.DiscordVoice.Speaking(false)
|
dd.Bridge.DiscordVoice.Speaking(false)
|
||||||
streaming = false
|
streaming = false
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,10 @@ func (m MumbleDuplex) fromMumbleMixer(ctx context.Context, wg *sync.WaitGroup, t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(toDiscord) > 20 {
|
||||||
|
log.Println("Debug: Warning Discord buffer size")
|
||||||
|
}
|
||||||
|
|
||||||
if sendAudio {
|
if sendAudio {
|
||||||
select {
|
select {
|
||||||
case toDiscord <- outBuf:
|
case toDiscord <- outBuf:
|
||||||
|
Loading…
Reference in New Issue
Block a user