This repository provides a quick example demonstrating how to access the Narakeet streaming Text to Speech API from Node.js.
The example sends a request to generate audio from text and saves it to output.mp3 in the local directory.
Note that Narakeet also has a text to speech API to generate long content, suitable for larger conversion tasks.
This example works with Node.js 18 and later (uses built-in fetch). You can run it inside Docker (then it does not require a local Node.js installation), or on a system with Node.js 18 or later.
- Set and export a local environment variable called
NARAKEET_API_KEY, containing your API key. - Optionally modify the voice and text parameters in
tts.mjs, which control the text to speech synthesis voice and the text sent to the API for synthesis. - To run inside docker, execute
make run - Or to run outside docker, on a system with
node, executenode tts.mjs
Check out https://www.narakeet.com/docs/automating/text-to-speech-api/ for more information on the Narakeet Text to Speech API