0
votes

I am trying to find out how to play audio files using a discord application and broadcasting this audio over specific channels in the server.

I am trying to make sort of a dispatch system that I need it to play an audio file, then after that audio completes, play one more audio file over 3 voice channels at the same time.

If possible, I would like to try and figure out how to make the bot play an audio and then take what a user wrote in a channel and have the bot play that over the voice channel, like an electronic dispatch system.

1

1 Answers

0
votes

A discord bot can only join one voice channel at a time. Your best bet is to play the audio in one channel and then move channels and play the audio. The text to speech could be handled by various free APIs (my recommendation is Google's). Take the message, send the content to the API, download the response as an mp3 (or whatever the default response format is) and play the file in each voice channel. You may even be able to create a readableStream from the API response and use playStream to stream the response instead of downloading.