CrispyBaguette / fb-chat-stt

Uses fbchat and the GCP to perform speech recognition on audio messages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fb-chat-stt

Uses fbchat and the Google Cloud Platform to perform speech recognition on audio messages.

Introduction

A few of my friends sometimes use Messenger voice messages in group threads, which annoys me to no end when I try to catch up to the conversation.

To remedy to that problem, I developed a bit of glue to sit between the wonderful fbchat and the power of the Google Cloud Platform.

My program grabs messages from Messenger, sends them to a GCS bucket, converts them to text using the speech to text capabilities of the GCP, and finally sends them back to the thread.

Usage

The easiest way to use this is to grab the Docker image:

docker pull crispybaguette/fb-chat-stt:latest

There are a few parameters to pass using environment variables, so I recommend using a dedicated file (.env):

STT_BUCKET=<gcp bucket name>
STT_THREADS=<comma-separated list of messenger threads>
GOOGLE_APPLICATION_CREDENTIALS=/credentials/service-account.json
FB_USER=<your FB user name>
FB_PASSWORD=<your FB password>

You will need a GCP service account with read/write access to a bucket and access to the speech-to-text API. You can retrieve the thread ids as specified somewhere in this page.

Run the container with:

docker run --env-file .env -v <path to the service account credentials>:/credentials/service-account.json crispybaguette/fb-chat-stt

Send a voice message to one of the threads you specified in the .env file, and behold the magic.

About

Uses fbchat and the GCP to perform speech recognition on audio messages

License:MIT License


Languages

Language:Python 96.7%Language:Dockerfile 3.3%