Search code examples
javascriptspeech-to-textazure-cognitive-servicesazure-china

Intagrate China MS Azure Cognitive Services with the Global one for WEB


I am using Global MS Azure cognitive services SDK in WEB application (JavaScript) using websocket connection Speech-to-Text. How can I use Speech-to-Text with credentials for MS Azure China? It has different region at least and different link for websocket? Does exist another SDK for China?


Solution

  • Due to some impacts of policy in China, Azure China and Azure Global are two independent systems. If you want to use Azure Speech-to-Text service in China, you should have an Azure China subscription and create a speech-service.

    It does have different regions and endpoints in speech-service. If you are using JS SDK to do your development work, there are two things of Azure China Speech service that you need to know :

    1. There is only one region in China that you can create speech-service: chinaeast2
    2. Its endpoint is different from Azure global, as there is only one region that you can create/use Speech service, so there is only one endpoint here which is: chinaeast2.stt.speech.azure.cn

    If you are using JS SDK to call Azure Speech-to-Text services, you can still use this SDK here but you should change the endpoint in sdk source code, for instance, in microsoft.cognitiveservices.speech.sdk.bundle.js you should go to line 6293 to change its host from Azure Global to Azure China: enter image description here

    I also did some test on my side for you ,this is my speech service in Azure China : enter image description here

    Official samle html gets from here .

    Test result : enter image description here

    It works me perfectly on speech to text service.

    Hope it helps !