# Creates a recognizer with the given settings # Creates an audio configuration that points to an audio file.Īudio_filename = "whatstheweatherlike.wav"Īudio_input = speechsdk.AudioConfig(filename=audio_filename) Speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=service_region) Speech_key, service_region = "YourSubscriptionKey", "YourServiceRegion" # Replace with your own subscription key and service region (e.g., "chinaeast2"). # Creates an instance of a speech config with specified subscription key and service region.
Similar code can be seen on the official website, but it should be noted that the code only works in Azure Global's Speech service, and specific modifications need to be made for China (see below). Postman obtains Token reference as follows:Ģ, SDK to convert voice files to text (Python example):
If you want to use Authorization Token in REST API, you need to obtain Token first:Īs of February 2020, only East China 2 has Speech service, and its Token endpoint is:
It should be noted that Key or Authorization is a two choice relationship. Other considerations for building requests: Note: if you want to convert text to speech, you must use Authorization Token for authentication according to the above table. The Authorization Token is valid for 10 minutes.įor simplicity, this paper uses the OCP APIM subscription key method. Preparation: create Speech service of cognitive service:Īfter creation, two important parameters can be viewed on the page:ġ, The REST API converts voice files to text:įor the Speech API endpoint of Azure global, please refer to:Īs of February 2020, Speech service has been opened only in eastern China 2 regions, and the service endpoint is:įor Speech To Text, there are two authentication methods: SDK mode supports recognition of voice stream and voice file of microphone Today, what we are fighting is Speech To Text. You will be introduced to tools such as FairLearn and InterpretML that can help you detect bias and understand the results your models are generating.Speech service is a kind of cognitive service, which provides voice to text, text to voice, voice translation and so on. The book also covers ethical considerations that are becoming increasingly of concern when using AI to drive decision making.
Each chapter contains the information you need to implement artificial intelligence (AI) via Azure Cognitive Services in your personal and professional projects. The authors begin by introducing the tools and describing the steps needed to invoke libraries to analyze structured and unstructured text, speech, and pictures, and you will learn to create interactive chatbots using the Cognitive Services libraries.
The book also shows you how to use the algorithms provided by Cognitive Services to accelerate data analysis and development within your organization. This book introduces the suite of Azure Cognitive Services and helps you take advantage of the proven machine learning algorithms that have been developed by experts and made available through Cognitive Services, easily integrating those algorithms into your own applications without having to develop the algorithms from scratch.
Get started with Azure Cognitive Services and its APIs that expose machine learning as a service.