Skip to content

Use Google Cloud Speech to transcribe voice chats in Discord.

Notifications You must be signed in to change notification settings

dtinth/discord-transcriber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord transcriber bot

This bot listens to utterances in a specified voice channel, sends them to Google Cloud Speech-To-Text API (which supports more than 100 languages and dialects), and posts the transcription into a text channel.

Thanks to Discord, each user gets their own voice stream, which means this bot can figure out who said what.

Transcription costs $0.006 for each message shorter than 15 seconds.

Screenshot

Known issue: This bot somehow stops working after a while. I haven’t figured out how to fix it yet. If you’ve figured it out, please send a PR. Thanks!!

Configuration

Create these files:

discord.config.json

{
  "token": "________________________.______.___________________________",
  "guildId": "__________________",
  "voiceChannelName": "voice",
  "textChannelName": "voice-transcript",
  "languageCode": "en_US"
}

google-cloud.credentials.json

Put your service account’s JSON credentials here.

Running locally

Node.js required.

# Install dependencies
yarn

# Run the bot
yarn start

Running on a server with Docker

# Build a Docker image
docker build -t discord-transcriber .

# Create a folder to hold config
mkdir -p /etc/discord-transcriber

# Put configuration files there
cat > /etc/discord-transcriber/discord.config.json # Paste
cat > /etc/discord-transcriber/google-cloud.credentials.json # Paste

# Run the container
docker run -d \
  -v /etc/discord-transcriber/discord.config.json:/usr/src/app/discord.config.json \
  -v /etc/discord-transcriber/google-cloud.credentials.json:/usr/src/app/google-cloud.credentials.json \
  --restart=always \
  --name=discord-transcriber \
  discord-transcriber

# View logs
docker logs discord-transcriber

About

Use Google Cloud Speech to transcribe voice chats in Discord.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published