Text-to-speech using the Azure OpenAI TTS API
Install this plugin in the same environment as LLM.
llm install llm-azure-ttsThe plugin adds a new command, llm azure-tts. Use it like this:
llm azure-tts "Hello" --output audio.mp3The synthesized text will be output directly to the specified location.
For full options, run llm azure-tts --help.
The plugin will use the API key configured using:
llm keys set azure-tts
# Paste key hereYou can also pass an explicit API key using --key like this:
llm azure-tts "Hello" --key $AZURE_OPENAI_TTS_API_KEY --output audio.mp3To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd llm-azure-tts
python -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:
llm install -e '.[test]'To run the tests:
python -m pytest