cannawen / dota-gsi-discord-bot

Use Dota 2's Game State Integration API to make helpful announcements in a discord voice channel
MIT License
5 stars 2 forks source link

After a couple minutes, discord bot stops playing audio #15

Closed cannawen closed 1 year ago

cannawen commented 1 year ago

Steps to reproduce

Play an audio file on repeat on discord and wait for a while (a couple minutes) setInterval(() => announce("BOUNTY_RUNES"), 3000)

Expected

You will hear audio file every 3 seconds indefinitely

Actual

After a couple minutes, the audio stops playing

cannawen commented 1 year ago

Investigation

At the point the audio stops working, the following logs are generated:

Playing ./audio/bounty_runes.wav
Connection transitioned from ready to ready
Audio player transitioned from buffering to playing
Audio player transitioned from playing to idle
Playing ./audio/bounty_runes.wav
Connection transitioned from ready to ready
Audio player transitioned from buffering to playing
Connection transitioned from ready to connecting
Audio player transitioned from playing to autopaused
Connection transitioned from connecting to signalling
Playing ./audio/bounty_runes.wav
Connection transitioned from signalling to signalling
Audio player transitioned from buffering to playing
Audio player transitioned from playing to autopaused

It looks like the VoiceConnection is getting changed from connecting to signalling for unknown reasons

See documentation https://discordjs.guide/voice/voice-connections.html#cheat-sheet

cannawen commented 1 year ago

Looks like a known issue in the library

https://github.com/discordjs/discord.js/issues/9185

Investigating workarounds