easy-tts-mp3
v1.0.4
Published
Convert message to MP3 with multiple languages
Downloads
3
Readme
Easy TTS MP3 - 📄🔊
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
📥 Installation ↴
npm i easy-tts-mp3
NPM Package → 📦
🤔 How to use ↴
import easyTTSmp3 from 'easy-tts-mp3'
const stringFilePath = await easyTTSmp3(message, config?)
message
: String with text to convert to speechconfig?
: Object with TTS configuration (optional).
⚙️ TTS configuration ↴
|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' |
✅ Check Lang ↴
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.