/sanity-microservice-transcription

Example of a transcription microservice for sanity.io projects

Primary LanguagePython

🗣📝 Microservice for transcribing audio files uploaded to sanity.io

Demo on youtube

This transcription microservice is an example for how to leverage webhooks in Sanity. It takes uploaded audio files, and requests a transcription from assemblyai, and writes that on the file asset metadata. Obviously, it works best on spoken tracks (such as podcasts) and your machine learning fueled milage may vary (it's always fun though!).

The Python app uses Sanic, which is a Flask-like server with support for Python 3.5’s async capabilities, and is inspired by this blog on how to write such a microservice.

Deploying on ▲ now

Deploy to now

(remember to ☑️ Build using Docker)

Or clone this repo and follow these instructions:

  1. Register an account at assemblyai.com to get an API token
  2. Generate a Sanity token with write permissions at manage.sanity.io
  3. Find your project ID and dataset name ($ sanity projects list)
  4. Add an optional Slack Webhook URL if you want the service to notify a slack channel of ready transcriptions.
  5. Run now and paste the variables when prompted
  6. The now app URL should be copied automatically to your clipboard. You can now run sanity hook create in your Sanity project folder and paste in the URL when prompted for it.
  7. That's it!