simple tts mp3
1.1.0
توفر هذه الحزمة طريقتين لإنشاء ملفات صوت MP3 من النص باستخدام وحدة Google-TTS-API ، فهي متوافقة مع TypeScript أيضًا ، ابحث عنها على NPM!
إذا أعجبك ذلك ، يرجى ترك نجمة على جيثب
| طريقة | الخيارات [اختياري] | وصف |
|---|---|---|
| Createaudiofile | النص ، اسم الملف ، [لغة = 'en'] | يقوم بإنشاء ملف صوت MP3 من النص وإرجاع مساره النهائي - الوعد (سلسلة) |
| getaudiobuffer | نص ، [لغة = 'en'] | يخلق مخزن صوت MP3 من النص ويعيده - وعد (مخزن مؤقت) |
ex: ./folder/name ).تحقق من الويكي لرؤية جميع اللغات المدعومة من هذه الحزمة.
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?' ) ;