bwmarrin / dgvoice

Discordgo Voice - A sub project to work on voice implementation for Discordgo
BSD 3-Clause "New" or "Revised" License
100 stars 39 forks source link

PlayAudioFile never returns when not ready #8

Open jD91mZM2 opened 7 years ago

jD91mZM2 commented 7 years ago

When you return at https://github.com/bwmarrin/dgvoice/blob/master/dgvoice.go#L116, which means https://github.com/bwmarrin/dgvoice/blob/master/dgvoice.go#L195 waits forever, and never returns. I'd suggest closing the channel or something

jD91mZM2 commented 7 years ago

Another thing, printing an error there is not the best of ideas. Because everytime PlayAudioFile closes, it throws an error because SendPCM continues to live on.

bwmarrin commented 7 years ago

I think there's a lot of room for improvement here :)