diff --git a/discord.go b/discord.go index 71aced5..94e5b0f 100644 --- a/discord.go +++ b/discord.go @@ -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 } diff --git a/mumble.go b/mumble.go index 66a6a4a..1d363d2 100644 --- a/mumble.go +++ b/mumble.go @@ -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: