{"id":13402600,"url":"https://github.com/codeforequity-at/botium-speech-processing","last_synced_at":"2025-05-15T02:05:21.444Z","repository":{"id":36486001,"uuid":"225715843","full_name":"codeforequity-at/botium-speech-processing","owner":"codeforequity-at","description":"Botium Speech Processing","archived":false,"fork":false,"pushed_at":"2025-04-02T10:19:15.000Z","size":597,"stargazers_count":945,"open_issues_count":2,"forks_count":59,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-06T19:09:35.164Z","etag":null,"topics":["botium","speech-to-text","text-to-speech"],"latest_commit_sha":null,"homepage":"https://www.botium.at","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeforequity-at.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-03T21:06:46.000Z","updated_at":"2025-04-02T10:18:41.000Z","dependencies_parsed_at":"2024-01-14T06:54:07.553Z","dependency_job_id":"7131876b-234c-4b10-88af-9d87af7ca19c","html_url":"https://github.com/codeforequity-at/botium-speech-processing","commit_stats":{"total_commits":226,"total_committers":8,"mean_commits":28.25,"dds":0.4424778761061947,"last_synced_commit":"d49a3674deac46596fc613c69543d35399077bd3"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-speech-processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-speech-processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-speech-processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforequity-at%2Fbotium-speech-processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeforequity-at","download_url":"https://codeload.github.com/codeforequity-at/botium-speech-processing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248790634,"owners_count":21162063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["botium","speech-to-text","text-to-speech"],"created_at":"2024-07-30T19:01:18.184Z","updated_at":"2025-04-13T22:33:31.344Z","avatar_url":"https://github.com/codeforequity-at.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Botium Speech Processing\n\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()\n[![pullrequests](https://img.shields.io/badge/PR-welcome-green.svg)]()\n[![awesome](https://img.shields.io/badge/Awesome-for%20sure!-green.svg)]()\n\nBotium Speech Processing is a unified, developer-friendly API to the best available free and Open-Source Speech-To-Text and Text-To-Speech services.\n\n## What is it ?\n\nBotium 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.\n\n* With [Kaldi](https://kaldi-asr.org/) a reasonable speech recogniction performance is available with freely available data sources. \n* [MaryTTS](http://mary.dfki.de/) is currently the best freely available speech synthesis software\n* [SoX](http://sox.sourceforge.net/) is the _swiss army-knife_ for audio file processing\n\nWhile 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.\n\n**Read about the project history [here](https://chatbotslife.com/full-blown-open-source-speech-processing-server-available-on-github-4fb88a54d338)**\n\n### Possible Applications\n\nSome examples what you can do with this:\n\n* Synthesize audio tracks for Youtube tutorials\n* Build voice-enabled chatbot services (for example, IVR systems)\n  * see the [Rasa Custom Voice Channel](./connectors/rasa)\n* Classification of audio file transcriptions\n* [Automated Testing](https://wiki.botiumbox.com/how-to-guides/voice-app-testing/) of Voice services with [Botium](https://botium.ai)\n\n## Installation\n\n### Software and Hardware Requirements\n\n* 8GB of RAM (accessible for Docker) and 40GB free HD space (for full installation)\n* Internet connectivity\n* [docker](https://docs.docker.com/)\n* [docker-compose](https://docs.docker.com/compose/)\n\n_Note: memory usage can be reduced if only one language for Kaldi is required - default configuration comes with two languages._\n\n### Full Installation (Prebuilt Docker Images)\n\nClone or download this repository and start with docker-compose:\n\n    \u003e docker-compose up -d\n\nThis will download the latest released prebuilt images from Dockerhub. To download the latest developer images from Dockerhub:\n\n    \u003e docker-compose --env-file .env.develop up\n\nPoint your browser to http://127.0.0.1 to open the [Swagger UI](https://swagger.io/tools/swagger-ui/) and browse/use the API definition.\n\n### Slim Cloud-Specific Installation (Prebuilt Docker Images)\n\nFor the major cloud providers there are additional docker-compose files. If using those, the installation is more slim, as there is only the *frontend*-service required. For instance, add your Azure subscription key and Azure region key to the file *docker-compose-azure.yml* and start the services:\n\n    \u003e docker-compose -f docker-compose-azure.yml up -d\n\n### Optional: Build Docker Images\n\nYou can optionally built your own docker images (if you made any changes in this repository, for instance to download the latest version of a model). Clone or download this repository and run docker-compose:\n\n    \u003e docker-compose -f docker-compose-dev.yml up -d\n\nThis will take some time to build.\n\n### Configuration\n\nThis repository includes a reasonable default configuration:\n\n* Use MaryTTS for TTS\n* Use Kaldi for STT\n* Use SoX for audio file conversion\n* Languages included:\n  * German\n  * English\n\nConfiguration changes with [environment variables](./frontend/resources/.env). See comments in this file.\n\n**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_\n\n### Request-Specific Configuration\n\nIf there is a JSON-formatted request body, or a multipart request body, certain sections are considered:\n\n* **credentials** to override the server default credentials for cloud services\n* **config** to override the server default settings for the cloud API calls\n\n*See samples below*\n\n### Securing the API\n\nThe 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.\n\n### Caching\n\nFor 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:\n\n* frontent/resources/.cache/stt\n* frontent/resources/.cache/tts\n\n## Testing\n\nPoint your browser to http://127.0.0.1/ to open Swagger UI to try out the API.\n\nPoint your browser to http://127.0.0.1/dictate/ to open a rudimentary [dictate.js-interface](https://github.com/Kaljurand/dictate.js) for testing speech recognition (_for Kaldi only_)\n\n_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._\n\nPoint your browser to http://127.0.0.1/tts to open a MaryTTS interface for testing speech synthesis.\n\n### Real Time API\n\nIt is possible to stream audio from real-time audio decoding: Call the **/api/sttstream/{language}** endpoint to open a websocket stream, it will return three urls:\n\n* wsUri - the Websocket uri to stream your audio to. By default, it accepts wav-formatted audio-chunks\n* statusUri - check if the stream is still open\n* endUri - end audio streaming and close websocket\n\n## File System Watcher\n\nPlace audio files in these folders to receive the transript in the folder _watcher/stt_output_:\n\n* watcher/stt_input_de\n* watcher/stt_input_en\n\nPlace text files in these folders to receive the synthesized speech in the folder _watcher/tss_output_:\n\n* watcher/tts_input_de\n* watcher/tts_input_en\n\n## API Definition\n\nSee [swagger.json](./frontend/src/swagger.json):\n\n* HTTP POST to **/api/stt/{language}** for Speech-To-Text\n\n    \u003e curl -X POST \"http://127.0.0.1/api/stt/en\" -H \"Content-Type: audio/wav\" -T sample.wav\n\n* HTTP POST to **/api/stt/{language}** for Speech-To-Text with Google, including credentials\n\n    \u003e curl -X POST \"http://127.0.0.1/api/stt/en-US?stt=google\" -F \"google={\\\"credentials\\\": {\\\"private_key\\\": \\\"xxx\\\", \\\"client_email\\\": \\\"xxx\\\"}}\" -F content=@sample.wav\n\n* HTTP POST to **/api/stt/{language}** for Speech-To-Text with Google, including switch to MP3 encoding\n\n    \u003e curl -X POST \"http://127.0.0.1/api/stt/en-US?stt=google\" -F \"google={\\\"config\\\": {\\\"encoding\\\": \\\"MP3\\\"}}\" -F content=@sample.mp3\n\n* HTTP POST to **/api/stt/{language}** for Speech-To-Text with IBM, including credentials\n\n    \u003e curl -X POST \"http://127.0.0.1/api/stt/en-US?stt=ibm\" -F \"google={\\\"credentials\\\": {\\\"apikey\\\": \\\"xxx\\\", \\\"serviceUrl\\\": \\\"xxx\\\"}}\" -F content=@sample.wav\n\n* HTTP GET to **/api/tts/{language}?text=...** for Text-To-Speech\n\n    \u003e curl -X GET \"http://127.0.0.1/api/tts/en?text=hello%20world\" -o tts.wav\n\n* HTTP POST to **/api/convert/{profile}** for audio file conversion\n\n    \u003e curl -X POST \"http://127.0.0.1/api/convert/mp3tomonowav\" -H \"Content-Type: audio/mp3\" -T sample.mp3 -o sample.wav\n\n## Contributing\n\n_To be done: contribution guidelines._\n\nWe are open to any kind of contributions and are happy to discuss, review and merge pull requests.\n\n## Big Thanks\n\nThis project is standing on the shoulders of giants.\n\n* **[Kaldi GStreamer server](https://github.com/alumae/kaldi-gstreamer-server)** and **[Docker images](https://github.com/jcsilva/docker-kaldi-gstreamer-server)**\n* **[MaryTTS](http://mary.dfki.de/)**\n* **SVOX Pico Text-to-Speech**\n* **[Kaldi](https://kaldi-asr.org/)**\n* **[Kaldi Tuda Recipe](https://github.com/uhh-lt/kaldi-tuda-de)**\n* **[Zamia Speech](https://github.com/gooofy/zamia-speech)**\n* **[Deepspeech](https://github.com/mozilla/DeepSpeech)** and **[Deepspeech German](https://github.com/AASHISHAG/deepspeech-german)**\n* **[SoX](http://sox.sourceforge.net/)**\n* **[dictate.js](https://github.com/Kaljurand/dictate.js)**\n\n## Changelog\n\n### 2022-03-06\n* Voice effects to consider audio file length\n\n### 2022-02-28\n\n* Applied Security Best Practices (not run as root user)\n\n### 2022-01-12\n\n* Added support for Azure Speech Services\n\n### 2021-12-07\n\n* Added endpoints for streaming audio and responses\n\n### 2021-12-01\n\n* Added option to hand over cloud credentials in request body\n\n### 2021-01-26\n\n* Added several profiles for adding noise or other audio artifacts to your files\n* Added custom channel for usage with Rasa\n\n### 2020-12-18\n\n* Adding support for Google Text-To-Speech\n* Adding support for listing and using available TTS voices\n* Added sample docker-compose configurations for PicoTTS and Google\n\n### 2020-03-05\n\n* Optional _start_/_end_ parameters for audio file conversion to trim an audio file by time codes formatted as mm:ss (_01:32_)\n\n### 2020-02-22\n\n* Additional endpoint to calculate the Word Error Rate (Levenshtein Distance) between two texts\n* When giving the _hint_-parameter with the expected text to the STT-endpoint, the Word Error Rate will be calculated and returned\n* 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)\n\n### 2020-01-31\n\n* Using pre-trained models from [Zamia Speech](https://github.com/gooofy/zamia-speech) for speech recognition\n* Using latest [Kaldi](https://kaldi-asr.org/) build\n* Added _file system watcher_ to transcribe and synthesize audio files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforequity-at%2Fbotium-speech-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeforequity-at%2Fbotium-speech-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforequity-at%2Fbotium-speech-processing/lists"}