An API wrapper for the Voice RSS Text-To-Speech API
The Voice RSS Text-To-Speech API creates a high quality audio stream with a very simple implementation. This npm module is a wrapper for this API to make it easy to implement in your Node or JavaScript projects.
Table of contents:
Quickstart
Before you begin
Installing the client library
// npmnpm install voice-rss --save-dev // yarnyarn add voice-rss --dev
Initiate the client library
// Imports the Voice RSS client library: es6 import (alternative 1); // Imports the Voice RSS client library: require (alternative 2)const VoiceRSSWebApi = ; // Instantiates the clientconst VoiceRSS = ;VoiceRSS; // Instantiates the client with an api keyconst VoiceRSS = 'API_KEY';
Using the client library
Here are three examples of how to use the client library
// callback implementation// the second argument is the options// see "Default options" section below for available options and for setting options all at once// see "Setting options" section below to set options one by oneVoiceRSS; // promise implementation// you can pass the options as the second argument, as in the callback implementationVoiceRSS ; // async/await implementation// you can pass the options as the second argument, as in the callback implementationasync { const audio = await VoiceRSS; // play the audio audio; // OR console log the audio (base64 encoding) console;};
Setting options
VoiceRSS;VoiceRSS;VoiceRSS;VoiceRSS;VoiceRSS;VoiceRSS;VoiceRSS;
Getting options
VoiceRSS;VoiceRSS;VoiceRSS;VoiceRSS;VoiceRSS;VoiceRSS;VoiceRSS;
Default options
const options = hl: 'en-us' r: 0 c: 'mp3' f: '44khz_16bit_stereo' ssml: false b64: false;
Available options
All of the available options can be found in the official documentation
Versioning
This library follows Semantic Versioning.
Contributing
Contributions welcome! See the Contributing Guide.
License
MIT
See LICENSE
To Do
- 100% test coverage
- Implement typescript
- Minimize bundle size