Skip to content

joni1802/asterisk-sound-generator

Repository files navigation

Asterisk Sound Generator ☎️

If you just want to download the prebuilt sound files, take a look at the Github releases of this project.

This is a CLI tool for generating Asterisk sound files based of the original transcriptions from the Asterisk Open Source project. The goal is to provide better language support for currently unsupported languages like German. The sound files can be used by any phone software based on Asterisk - like FreePBX. The tool uses the DeepL and ChatGPT API to translate the transcriptions and the Google Text-To-Speech API to generate the sound files. However, the translations still needs some manual work. The tool also converts the generated sound files to the common codecs.

READMEs

Prerequirements

  • Installed Node.js runtime (atleast Version 20.0.0)
  • DeepL account with access to the DeepL API (Free for up to 500.000 characters per month)
  • OpenAI account (Not free but really cheap)
  • Google Cloud account with access to the Google Text-to-Speech API (Free for up to 1 Mio. characters per month)
  • FFmpeg binary for converting the sound files

Install CLI

  1. Clone the repository git clone https://github.com/joni1802/asterisk-sound-generator.git.
  2. Change into the directory cd asterisk-sound-generator
  3. Install the Node modules npm install
  4. Start the CLI tool npm run start

Using Google Text to Speech

  1. Create a service account for the Google Text to Speech API.
  2. Create a key pair for the service account and download the JSON file.
  3. Create a .env file in the root directory of this project.
  4. Add GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/key.json to the .env file.

More details: Using the Text-to-Speech API with Node.js

Using Coqui TTS (not supported yet)

  1. Install python.
  2. Install Coqui TTS by running pip install TTS.

More details: Coqui TTS Github Repo

Using DeepL API for translations

  1. Create a free DeepL account.
  2. Generate an API key.
  3. Create a .env file in the root directory of this project.
  4. Add DEEPL_AUTH_KEY=<your deepl api key> to the .env file.

Using ChatGPT for translations

  1. Create an OpenAI account.
  2. Generate an API key.
  3. Create a .env file in the root directory of this project.
  4. Add OPEN_AI_AUTH_KEY=<your deepl api key> to the .env file.

Using FFmpeg for converting audio files

  1. Download the prebuilt FFmpeg binaries from an official source. For windows I suggest to download the full build from gyan.dev. This version also contains the needed library for the GSM encoder.
  2. Copy the ffmpeg binary (executable) to the root directory of this project or add it to the PATH environment variable.

More usefull sources

About

CLI tool for generating Asterisk sound files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published