This is a simple node.js example of how to use the Azure AI to convert text to speech.
azure-ai-tts-voice_4.mp4
- Node.js v20+
- Azure account. If you're new to Azure, get an Azure account for free at https://azure.com/free
- A ressource key from the Azure Speech Portal (see https://learn.microsoft.com/azure/ai-services/speech-service/speech-studio-overview)
Rename the env.example
file to .env
and fill in the required information. Use the ressource key from the Azure Speech Portal, and the region where your ressource is located:
SPEECH_KEY=
SPEECH_REGION=
# Optional
SPEECH_VOICE_NAME=
SPEECH_LANGUAGE=
npm install
node index.js