
Research
/Security News
60 Malicious Ruby Gems Used in Targeted Credential Theft Campaign
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
cloud-text-to-speech
Advanced tools
Single interface to Google, Microsoft and Amazon Text-To-Speech.
Single interface to Google, Microsoft, and Amazon Text-To-Speech. NodeJS implementation of:
We welcome and value your ideas and suggestions to improve this project! To submit and vote for feature requests, please visit our Feature Requests Board.
On the board, you can:
Thank you for contributing to the development and improvement of Cloud Text-To-Speech!
There are essentially two ways to use Cloud Text-To-Speech:
TtsProviders.google
, TtsProviders.microsoft
, TtsProviders.amazon
to use the single provider at a time.TtsProviders.combine
to combine all providers and get all voices at once.To init configuration use:
//Do init once and run it before any other method
TtsUniversal.init({
provider: TtsProviders.amazon,
googleParams: { apiKey: "API-KEY" },
microsoftParams: { subscriptionKey: "SUBSCRIPTION-KEY", region: "eastus" },
amazonParams: { keyId: "KEY-ID", accessKey: "ACCESS-KEY", region: "us-east-1" },
withLogs: true
});
To change provider use:
TtsUniversal.setProvider(TtsProviders.microsoft);
To get the list of all voices use:
//Get voices
const voicesResponse = await TtsUniversal.getVoices();
const voices = voicesResponse.voices;
//Print all available voices
console.log(voices);
//Pick an English Voice
const voice = voices.find((voice) => voice.locale.code.startsWith('en-'));
To convert TTS and get audio use:
//Generate Audio for a text
const text = "Amazon, Microsoft and Google Text-to-Speech API are awesome";
const ttsParams = new TtsParamsUniversal({
voice: voice,
audioFormat: AudioOutputFormatUniversal.mp3_64k,
text: text,
rate: 'slow', //optional
pitch: 'default', //optional
});
const ttsResponse = await TtsUniversal.convertTts(ttsParams);
//Get the audio bytes.
const audioBytes = ttsResponse.audio;
To init configuration use:
//Do init once and run it before any other method
TtsUniversal.init({
provider: TtsProviders.combine,
googleParams: { apiKey: "API-KEY" },
microsoftParams: { subscriptionKey: "SUBSCRIPTION-KEY", region: "eastus" },
amazonParams: { keyId: "KEY-ID", accessKey: "ACCESS-KEY", region: "us-east-1" },
withLogs: true
});
To change provider use:
TtsUniversal.setProvider(TtsProviders.combine);
To get the list of all voices use:
//Get voices
const voicesResponse = await TtsUniversal.getVoices();
const voices = voicesResponse.voices;
//Print all available voices
console.log(voices);
//Pick an English Voice
const voice = voices.find((voice) => voice.locale.code.startsWith('en-'));
To convert TTS and get audio use:
//Generate Audio for a text
const text = "Amazon, Microsoft and Google Text-to-Speech API are awesome";
const ttsParams = new TtsParamsUniversal({
voice: voice,
audioFormat: AudioOutputFormatUniversal.mp3_64k,
text: text,
rate: 'slow', //optional
pitch: 'default', //optional
});
const ttsResponse = await TtsUniversal.convertTts(ttsParams);
//Get the audio bytes.
const audioBytes = ttsResponse.audio;
To init configuration use:
//Do init once and run it before any other method
TtsGoogle.init({
params: { apiKey: 'API-KEY' },
withLogs: true,
});
To get the list of all voices use:
//Get voices
const voicesResponse = await TtsGoogle.getVoices();
const voices = voicesResponse.voices;
//Print all voices
console.log(voices);
//Pick an English Voice
const voice = voices.find((voice) => voice.locale.code.startsWith('en-'));
To convert TTS and get audio use:
//Generate Audio for a text
const text = '<speak>Google<break time="2s"> Speech Service Text-to-Speech API is awesome!</speak>';
const ttsParams = new TtsParamsGoogle({
voice: voice,
audioFormat: AudioOutputFormatGoogle.mp3,
text: text,
rate: 'slow', //optional
pitch: 'default', //optional
});
const ttsResponse = await TtsGoogle.convertTts(ttsParams);
//Get the audio bytes.
const audioBytes = ttsResponse.audio;
To init configuration use:
//Do init once and run it before any other method
TtsMicrosoft.init({
params: { subscriptionKey: 'SUBSCRIPTION-KEY', region: 'eastus' },
withLogs: true,
});
To get the list of all voices use:
//Get voices
const voicesResponse = await TtsMicrosoft.getVoices();
const voices = voicesResponse.voices;
//Print all voices
console.log(voices);
//Pick an English Voice
const voice = voices.find((voice) => voice.locale.code.startsWith('en-'));
To convert TTS and get audio use:
//Generate Audio for a text
const text = '<speak>Microsoft<break time="2s"> Speech Service Text-to-Speech API is awesome!</speak>';
const ttsParams = new TtsParamsMicrosoft({
voice: voice,
audioFormat: AudioOutputFormatMicrosoft.audio48Khz192kBitrateMonoMp3,
text: text,
rate: 'slow', //optional
pitch: 'default', //optional
});
const ttsResponse = await TtsMicrosoft.convertTts(ttsParams);
//Get the audio bytes.
const audioBytes = ttsResponse.audio;
To init configuration use:
//Do init once and run it before any other method
TtsAmazon.init({
params: { keyId: 'KEY-ID', accessKey: 'ACCESS-KEY', region: 'us-east-1' },
withLogs: true,
});
To get the list of all voices use:
//Get voices
const voicesResponse = await TtsAmazon.getVoices();
const voices = voicesResponse.voices;
//Print all voices
console.log(voices);
//Pick an English Voice
const voice = voices.find((voice) => voice.locale.code.startsWith('en-'));
To convert TTS and get audio use:
//Generate Audio for a text
const text = '<speak>Amazon<break time="2s"> Speech Service Text-to-Speech API is awesome!</speak>';
const ttsParams = new TtsParamsAmazon({
voice: voice,
audioFormat: AudioOutputFormatAmazon.mp3,
text: text,
rate: 'slow', // optional
pitch: 'default', // optional
});
const ttsResponse = await TtsAmazon.convertTts(ttsParams);
//Get the audio bytes.
const audioBytes = ttsResponse.audio;
There are things you should take care of:
(new XMLSerializer()).serializeToString(new DOMParser().parseFromString(ssml, 'text/xml'))
.1.0.3
FAQs
Single interface to Google, Microsoft and Amazon Text-To-Speech.
We found that cloud-text-to-speech demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.