This repository provides a quick example demonstrating how to access the Narakeet Long Content API from Python.
The long content API is suitable for large audio conversion tasks, and can produce professional quality uncompressed WAV files using realistic text to speech.
Note that Narakeet also has a simpler text to speech API, suitable for smaller conversion tasks, that directly streams back the results. See the Streaming Text to Speech API Example for more information on how to use that.
The example sends a request to generate an audio file, then downloads the resulting audio into a local file.
The example uses the requests python library to send HTTPS requests to the Narakeet API.
To use this example, you will need Python (3.7 or more recent), and an API key for Narakeet.
- set and export a local environment variable called
NARAKEET_API_KEY, containing your API key (or modify audio.py line 4 to include your API key). - optionally edit audio.py and modify the output file type, voice, script and the function that handles progress notification (lines 5, 6, 7, and 9).
- run
pip install -r requirements.txtto install the required libraries - run
python audio.pyto create the output audio.
- set and export a local environment variable called
NARAKEET_API_KEY, containing your API key (or modify convert-vtt.py line 4 to include your API key). - optionally edit convert-vtt.py and modify the input file, format, voice and speed (lines 5-8).
- run
pip install -r requirements.txtto install the required libraries - run
python convert-vtt.pyto create the output audio.
Check out https://www.narakeet.com/docs/automating/text-to-speech-api/ for more information on the Narakeet API features.