simple tts mp3
1.1.0
Dieses Paket bietet zwei Methoden zum Erstellen von MP3-Audiodateien aus Text mit dem Google-TTS-API-Modul. Es ist auch mit TypeScript kompatibel und finden Sie es auf NPM!
Wenn Sie es mögen, hinterlassen Sie bitte einen Stern auf GitHub
| Verfahren | Optionen [optional] | Beschreibung |
|---|---|---|
| CreateAudioFile | Text, Dateiname, [Sprache = 'en'] | Erstellt eine MP3 -Audio -Datei aus Text und gibt ihren endgültigen Pfad zurück - Versprechen (String). |
| GetAudioBuffer | Text, [Sprache = 'en'] | Erstellt einen MP3 -Audiopuffer aus Text und gibt ihn zurück - Versprechen (Puffer) |
ex: ./folder/name ).Überprüfen Sie das Wiki, um alle von diesem Paket unterstützten Sprachen zu sehen.
npm install simple-tts-mp3 // Importing create file method from package
const { createAudioFile } = require ( 'simple-tts-mp3' ) ;
// Creates an "output.mp3" audio file with default English text
createAudioFile ( 'Hi, How are you?' , 'output' ) ;
// Creates an "output.mp3" audio file with Spanish text and promise resolved
createAudioFile ( 'Hola, ¿Cómo estás?' , 'output' , 'es' ) . then ( ( filepath ) => {
console . log ( filepath ) ;
} ) ;
// Creates an "output.mp3" audio file with Spanish text inside the "audios" folder and awaits filepath
const filepath = await createAudioFile ( 'Todo bien, gracias' , './audios/output' , 'es' ) ; // Importing create
const { getAudioBuffer } = require ( 'simple-tts-mp3' ) ;
// Creates an MP3 audio buffer with Spanish text and resolves the promise with it
getAudioBuffer ( 'Hola, ¿cómo estás?' , 'es' )
. then ( buffer => {
// Do something with the buffer
} ) ;
// Creates an MP3 audio buffer with default English text and awaits it
const buffer = await getAudioBuffer ( 'Hi, How are you?' ) ;