Library for easily converting text to speech in multiple languages. No dependencies.
Note
This library uses the Google Translate API with the base URL https://translate.google.com/translate_tts.
Example (Copy and paste into the browser) ↴
https://translate.google.com/translate_tts?ie=UTF-8&q=Esto%20es%20un%20test&tl=es-ES&total=1&idx=0&textlen=15&client=tw-ob&prev=input&ttsspeed=1
npm i easy-tts-mp3
NPM Package → 📦
import easyTTSmp3 from 'easy-tts-mp3'
const stringFilePath = await easyTTSmp3(message, config?)
-
message
: String with text to convert to speech -
config?
: Object with TTS configuration (optional).
Name | Description | Default |
---|---|---|
Lang | The language of the TTS - All Languages | 'es-ES' |
Path | The relative path to save the file | ' . ' |
Filename | The file name | 'tts.mp3' |
import { checkLang } from 'easy-tts-mp3'
const check = checkLang(lang)
lang
: The language of the TTS (Example: 'es-ES').
This function checks if the language exists in this library.