Skip to content

Python example of using the Azure Speech Services API for text-to-speech and speech-to-text conversion.

Notifications You must be signed in to change notification settings

labcabrera/azure-speech-api

Repository files navigation

Azure Speech API

API básica para la integración con Azure Speech Service.

Necesitaremos crear un recurso de Speech Service en el portal de Azure para obtener la clave y la región necesarias para autenticar las solicitudes.

Para ejecutar la API, sigue estos pasos:

python3 -m venv .venv

source .venv/bin/activate

pip install -r requirements.txt

export SPEECH_KEY="your_key_here"

export SPEECH_REGION="your_region_here"

uvicorn src.app:app --reload --port 8000

Ejemplos de uso

Text to Speech

curl -X POST http://localhost:8000/api/v1/text-to-speech \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hola, este es un ejemplo de conversión de texto a voz",
    "language": "es-ES",
    "voice": "es-ES-ElviraNeural"
  }' \
  --output output.mp3

Speech to Text

curl -X POST http://localhost:8000/api/v1/speech-to-text \
  -H "Content-Type: multipart/form-data" \
  -F "file=@output.mp3" \
  -F "language=es-ES"

About

Python example of using the Azure Speech Services API for text-to-speech and speech-to-text conversion.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages