This is a demo of the voice feature of Discord API, via Discord.js SDK.
- The Broadcast bot can play an audio file in a voice channel
- The Transcriber bot can listen to a user and transcribe what they say
- Prerequisites:
- Install
ffmpeg
: http://ffmpeg.org/ - Create a Google Cloud project, enable the
Speech
API - Have a service account ready, create and download the JSON credentials
- Install node.js dependencies
npm install
- Create a
.env
file in the root directory
GOOGLE_APPLICATION_CREDENTIALS=[path to the JSON credentials]
DISCORD_BOT_TOKEN_BROADCASTER=[your Discord bot token]
DISCORD_BOT_TOKEN_TRANSCRIBER=[your Discord bot token]
- Run the bot
npm start
play
: to play the audio filestop
: to stop playing the audio filelisten
: listen to the speech and transcribe