Coder Social home page Coder Social logo

mstraughan86 / botium-speech-processing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codeforequity-at/botium-speech-processing

1.0 1.0 0.0 93 KB

Botium Speech Processing

Home Page: https://www.botium.at

License: MIT License

JavaScript 76.92% Dockerfile 11.15% Makefile 0.39% Shell 11.54%

botium-speech-processing's Introduction

Botium Speech Processing

license pullrequests awesome

Botium Speech Processing is a unified, developer-friendly API to the best available free and Open-Source Speech-To-Text and Text-To-Speech services.

What is it ?

Botium Speech Processing is a get-shit-done-style Open-Source software stack, the configuration options are rudimentary: it is highly opinionated about the included tools, just get the shit done.

  • With Kaldi a reasonable speech recogniction performance is available with freely available data sources.
  • MaryTTS is currently the best freely available speech synthesis software
  • SoX is the swiss army-knife for audio file processing

While the included tools in most cases cannot compete with the big cloud-based products, for lots of applications the trade-off between price and quality is at least reasonable.

Read about the project history here

Possible Applications

Some examples what you can do with this:

  • Synthesize audio tracks for Youtube tutorials
  • Build voice-enabled chatbot services (for example, IVR systems)
  • Classification of audio file transcriptions
  • Automated Testing of Voice services with Botium

Installation

Software and Hardware Requirements

  • 8GB of RAM (accessible for Docker) and 40GB free HD space
  • Internet connectivity
  • docker
  • docker-compose

Note: memory usage can be reduced if only one language is required - default configuration comes with two languages.

Build Docker Containers

Clone or download this repository and start with docker-compose:

> docker-compose up -d

This will take some time to build.

Point your browser to http://127.0.0.1 to open the Swagger UI and browse/use the API definition.

Configuration

This repository includes a reasonable default configuration:

  • Use MaryTTS for TTS
  • Use Kaldi for STT
  • Use SoX for audio file conversion
  • Languages included:
    • German
    • English

Configuration changes with environment variables. See comments in this file.

Recommendation: Do not change the .env file but create a .env.local file to overwrite the default settings. This will prevent troubles on future git pull

Securing the API

The environment variable BOTIUM_API_TOKENS contains a list of valid API Tokens accepted by the server (separated by whitespace or comma). The HTTP Header BOTIUM_API_TOKEN is validated on each call to the API.

Caching

For performance improvements, the result of the speech-to-text and text-to-speech calls are cached (by MD5-hash of audio or input text). To enforce reprocessing empty the cache directories:

  • frontent/resources/.cache/stt
  • frontent/resources/.cache/tts

Testing

Point your browser to http://127.0.0.1/ to open Swagger UI to try out the API.

Point your browser to http://127.0.0.1/dictate to open a rudimentary dictate.js-interface for testing speech recognition (for Kaldi only)

Attention: in Google Chrome this only works with services published as HTTPS, you will have to take of this yourself. For example, you could publish it via ngrok tunnel.

Point your browser to http://127.0.0.1/tts to open a MaryTTS interface for testing speech synthesis.

Real Time API

Available for Kaldi only

There are Websocket endpoints exposed for real-time audio decoding. Find the API description in the Kaldi GStreamer Server documentation.

The Websocket endpoints are:

  • English: ws://127.0.0.1/stt_en/client/ws/speech
  • German: ws://127.0.0.1/stt_de/client/ws/speech

File System Watcher

Place audio files in these folders to receive the transript in the folder watcher/stt_output:

  • watcher/stt_input_de
  • watcher/stt_input_en

Place text files in these folders to receive the synthesized speech in the folder watcher/tss_output:

  • watcher/tts_input_de
  • watcher/tts_input_en

API Definition

See swagger.json:

Contributing

To be done: contribution guidelines.

We are open to any kind of contributions and are happy to discuss, review and merge pull requests.

Big Thanks

This project is standing on the shoulders of giants.

Changelog

2020-03-05

  • Optional start/end parameters for audio file conversion to trim an audio file by time codes formatted as mm:ss (01:32)

2020-02-22

  • Additional endpoint to calculate the Word Error Rate (Levenshtein Distance) between two texts
  • When giving the hint-parameter with the expected text to the STT-endpoint, the Word Error Rate will be calculated and returned
  • When multiple STT- or TTS-engines are configured, select the one to use with the stt or tts parameter (in combination with the Word Error Rate calculation useful for comparing performance of two engines)

2020-01-31

  • Using pre-trained models from Zamia Speech for speech recognition
  • Using latest Kaldi build
  • Added file system watcher to transcribe and synthesize audio files

botium-speech-processing's People

Stargazers

Roman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.