WIP: Not for using at this moment.
Amai TTS SDK
Tools designed to make complex, machine learning things easy to understand and implement for apps developers.
What can I do with that?
- Teach your applications to speak with a human voice in different emotional colors and languages
- Give your users an unforgettable voice UX with adaptive audio player
- Add TTS functionality to your web service in 5 lines of code
For other programming languages, you should use
yarn add amai-sdk
npm install --save amai-sdk
Basic browser example
// Create streamconst stream = await sdksynthesis// Add stream to playerconst player = sdkplayer// Play live streamplayer// Adding text for synthesis.// As a result, the synthesized sentence "I love amai!",// will be played in the audio player in your browser!stream
Stream is an entity to which you can add text and listen to. Technically it's an Apple HLS format, VLC for example. This allows you to listen synthesis result in any player that supports this format. Streams may not have unique names.
console.logstream.id === stream1.id && stream.id === stream2.id// truestream.addText'I love amai.'// this is the alias forsynthesis.addText'streamName', text//orsdk.synthesis.addText'streamName', text
To implement a more free limit, authorization is required.
Free limit - 10 000 symbols. You can use an api without setting a key within the free limit.
sdk.key = 'YourApiKey'// Now you can make authorized requests.await sdk.synthesis.createStream'streamName'
or you can authorize at any nested import
synthesis.key = 'YourApiKey'// Now you can make authorized requests.//When you install the key on any SDK import - it is automatically installed on all instancesconsole.logsdk.key === synthesis.key//true
Specificity of usage
- If you have exceeded the limit, you will receive an audio message substituting the synthesis result and detailed console.log with ways to solve the problem.
- If you do not set an api key, a temporary key with a free limit will be automatically generated and set before the first call to the api server.
In order to control the use of API resources, a mechanism for managing user keys has been implemented.
The SDK can be built into the client and server code, permission and access control is based on metadata included in the jwt key. SDK is a wrapper over HTTP calls to the REST backend, that makes it easy to work with your own logic.
npm t: Run test suite
npm start: Run
npm run buildin watch mode
npm run test:watch: Run test suite in interactive watch mode
npm run test:prod: Run linting and generate coverage
npm run build: Generate bundles and typings, create docs
npm run lint: Lints code
npm run commit: Commit using conventional commit style (husky will tell you to use it if you haven't 😉)
Todo test cases
- Can add text only to self streams
Long term todo
- Change demo app to player example
- Migrate from travis CI to gitlab CI