Python examples for the Speech Translation API
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 2 commits ahead, 3 commits behind MicrosoftTranslator:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes
.gitignore Initial commit Mar 29, 2016
LICENSE Initial check in and updated README Mar 29, 2016
README.md bugfix Mar 1, 2018
auth.py Update sample to use Azure Cognitive Services authentication. Apr 18, 2017
doa.py bugfix Mar 1, 2018
languages.py Update sample to use Azure Cognitive Services authentication. Apr 18, 2017
main.py bugfix Mar 1, 2018
speech.py Update sample to use Azure Cognitive Services authentication. Apr 18, 2017

README.md

Python-Speech-Translate

This sample requires a subscription with Microsoft Translator Speech Translation API, which is part of Microsoft Azure Cognitive Services. Visit the Speech Translation API documentation page to get started.

Setup

Samples are written for Python 2 and assume that pip is installed. Recent versions of Python 2.7 come with pip.

The requests and websocket-client packages are required:

pip install requests
pip install websocket-client

Getting list of supported languages (languages.py)

This sample demonstrates how to obtain the list of languages supported by the Speech Translation API.

Run the example with:

python languages.py

Audio file translate (speech.py)

This sample demonstrates the use of Microsoft Translator Speech Translation API by translating an audio file.

Before running the example.

  1. Fill your Azure Data Market Credentials

    client_secret = 'INSERT YOUR CLIENT SECRET'

  2. Fill in the name of your audio file (PCM, 16 bit, 16 kHz, mono, WAV)

    audio_file = 'INSERT AUDIO FILE FULL PATH'

Run the example with:

python speech.py

Realtime speech translate (main.py)

This sample demonstrates the use of Microsoft Translator Speech Translation API

Before running the example.

  1. Fill your Azure Data Market Credentials

    client_secret = 'INSERT YOUR CLIENT SECRET'

Run the example with:

pip install https://github.com/xiongyihui/python-webrtc-audio-processing/archive/master.zip
pip install https://github.com/voice-engine/voice-engine/archive/master.zip
pip install pixel-ring
python main.py