infobot-yandex-tts

1.0.2 • Public • Published

infobot-yandex-tts

Node.JS library for Yandex Speech Cloud service. Library can be used to generate audio files from text with TTS service.

To work with this library you need to obtain from Yandex Cloud:

  • Private key in PEM format
  • Service ID
  • Service Key
  • Folder ID

Please check this page for information about service accounts.

Audio file generation example:

const TTS = require('infobot-yandex-tts');
const fs = require('fs');
 
const key = SERVICE_KEY ;
const folder_id = FOLDER_ID;
const service_id = SERVICE_ID;
 
const tts = new TTS(service_id, key, folder_id, fs.readFileSync('./yandex.pem'));
tts.generateAudio('Привет, это тест. А меня зовут Алёна.', {
    voice: 'alena'
}).then(res => {
    fs.writeFileSync('out.ogg', res);
}).catch(err => {
    console.error(err);
});

Provided by INFOBOT LLC. under ISC license.

Package Sidebar

Install

npm i infobot-yandex-tts

Weekly Downloads

5

Version

1.0.2

License

ISC

Unpacked Size

24.8 kB

Total Files

5

Last publish

Collaborators

  • infobot