A simple bot that transcribes speech in a Discord voice chat using DeepSpeech and shares it with DCC-Client users using the PubNub API.
First of all, a Discord bot will need to be registered. To get the bot to work, a free account with PubNub is needed as well as an acoustic model for Deep Speech (download pre-made model).
In index.js, add your PubNub publish, subscribe and secret keys in the following fields:
const pubnub = new PubNub({
publishKey: "ADD PUBLISH KEY",
subscribeKey: "ADD SUBSCRIBE KEY",
secretKey: "ADD SECRET KEY"
});
Add your Discord bot token in the following field at the end of index.js:
client.login("ADD DISCORD BOT TOKEN");
Add your Discord server ID and the voice channel ID token in the following fields in config.json:
"serverID": "ADD DISCORD SERVER ID",
"voiceChannelID": "ADD YOUR VOIE CHANNEL ID"
Finally, add the path to your model and scorer in the following fields in speechToText.js:
const modelPath = 'ADD YOUR DEEPSPEECH MODEL PATH';
const scorerPath = 'ADD YOUR DEEPSPEECH SCORER PATH';
If you wish to use the DCC-Client to see the transcriptions on the screen, it will also need to be setup to use your PubNub keys.