correct debug message and add timing

This commit is contained in:
Tyler Stiene 2021-04-08 01:14:24 -04:00
parent 910eaa5954
commit dcc3fd48b4
2 changed files with 8 additions and 2 deletions

View File

@ -59,6 +59,7 @@ func (dd *DiscordDuplex) discordSendPCM(ctx context.Context, wg *sync.WaitGroup,
lastReady := true
var readyTimeout *time.Timer
var speakingStart time.Time
wg.Add(1)
@ -72,7 +73,8 @@ func (dd *DiscordDuplex) discordSendPCM(ctx context.Context, wg *sync.WaitGroup,
<-ticker.C
if len(pcm) > 1 {
if !streaming {
log.Panicln("Debug: Discord start speaking")
log.Println("Debug: Discord start speaking")
speakingStart = time.Now()
dd.Bridge.DiscordVoice.Speaking(true)
streaming = true
}
@ -108,7 +110,7 @@ func (dd *DiscordDuplex) discordSendPCM(ctx context.Context, wg *sync.WaitGroup,
} else {
if streaming {
log.Panicln("Debug: Discord stop speaking")
log.Println("Debug: Discord stop speaking", time.Since(speakingStart).Milliseconds(), "ms")
dd.Bridge.DiscordVoice.Speaking(false)
streaming = false
}

View File

@ -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 {
select {
case toDiscord <- outBuf: