Inspiration
The hackathon description said to build a Discord bot that detected audio files and translated them to text if a user wanted the bot to do so.
What it does
The Discord bot will respond to a command that is a response to the message with the file and download the audio file after looking at the attachments in the reference of the command message. It then uses a library to translate the audio file to text which it then sends to the channel.
How I built it
I had a bit of experience coding Discord bots already so I finished the bot framework (listening to commands and looking for reference messages) in about 10 minutes. I then searched online to find out what libraries could be used to detect audio and found SpeechRecognition which was a relatively simple and easy library to use.
Challenges we ran into
At first I had planned on automatically looking for audio files when the bot receives the message but I read the hackathon description again and discovered that this was not true so I had to re-write all the code again. I also had trouble installing ffmpeg on my computer considering that their download link was down.
Accomplishments that we're proud of
I'm proud that my bot works and the rate of speed at which I wrote it.
What we learned
I learned how to use a speech to text library in Python and how to integrate it into a DIscord bot for easier use.
What's next for Discord Audio Bot
I plan on adding more features in the future such as commands to automatically detect all audio files and convert them to text as well as code to handle multiple audio file attachments (right now it detects the last one but it already loops over all attachments)
Side note: I am unable to record a video on my device so I can't provide one. I'm sorry.
Built With
- discord
- python
Log in or sign up for Devpost to join the conversation.