Azure Speech services

Swiftly convert audio to text for natural responsiveness.

  • Speech to Text – Converts spoken audio to text for intuitive interaction
  • Text to Speech – Give natural voice to your apps
  • Speech Translation
  • Speaker Recognition - Use speech to identify and verify individual speakers

Why?

We are entering the voice-enabled digital assistant era.

Home assistants

Powerful voice Assistants, powered by Cloud technology, that gets thing done handsfree.

  • Ask questions
  • Personalized help with your schedule
  • Control smart devices
  • Make and receive hands-free calls
  • And what more?

Azure

To get started using the Azure Custom Speech Service, you first need to link your user account to an Azure subscription.

Speech Services

Next select the Speech Services from the Azure Store.

Authentication

Get your authentication key for the Speech API.


SDK

SDK provides access to Speech to Text, Speech Translation, and Intent Recognition.

Microsoft Cognitive Services Speech SDK

The native and managed libraries for the Microsoft Cognitive Services Speech SDK.

Install via NuGet https://www.nuget.org/packages/Microsoft.CognitiveServices.Speech

Or download from documentation at https://docs.microsoft.com/en-us/azure/cognitive-services/Speech-Service/.

Support

Supported programming lanuages & platforms.

Languages: C#, .NET Standard, C/C++, Java, Objective C, JavaScript
Platforms: Windows 10, Linux, Android, iOS, macOS, ARM64 Devices, Browser, REST

Example

Browser Implementaion

<!-- Speech SDK reference sdk. -->
<script src="js/microsoft.cognitiveservices.speech.sdk.bundle.js"></script>
<!-- Custom scripts for this template -->
<script src="js/speech.js"></script>


Code

A browser example
                
var subscriptionKey = "{your-private-key}";
    var serviceRegion = "{westeurope}";
    var speechRecognitionLanguage = "{your-preferred-language}";

    let commandReg = /^hey centric/i;
    var authorizationToken;
    var SpeechSDK;

document.addEventListener("DOMContentLoaded", function () {
    startRecognizeOnceAsyncButton = document.getElementById("startRecognizeOnceAsyncButton");
    startRecognizeOnceAsyncButton.addEventListener("click", function () {

    var speechConfig;
    if (authorizationToken) { 
        speechConfig = SpeechSDK.SpeechConfig.fromAuthorizationToken(authorizationToken, serviceRegion); 
    } else {
        if (subscriptionKey === "") { return; }
        speechConfig = SpeechSDK.SpeechConfig.fromSubscription(subscriptionKey, serviceRegion);
    }
    speechConfig.speechRecognitionLanguage = speechRecognitionLanguage;

    var audioConfig = SpeechSDK.AudioConfig.fromDefaultMicrophoneInput();

        var recognizer = new SpeechSDK.SpeechRecognizer(speechConfig, audioConfig);
         recognizer.recognizeOnceAsync(
            function (result) {
                recognizer.close();
                recognizer = undefined;

                startRecognizeOnceAsyncButton.disabled = false;

                if (commandReg.test(result.text)) {
                    voiceCommand(result.text);
                }

               ...
            },
            function (err) {
                ...
            }
            ...
        });

        if (!!window.SpeechSDK) {
            SpeechSDK = window.SpeechSDK;
            startRecognizeOnceAsyncButton.disabled = false;
            ...
             if (typeof RequestAuthorizationToken === "function") {
                RequestAuthorizationToken();
            } 
        }
    });

                

Commands

Recognize intents from speech.
                    
    let commandReg = /^hey centric/i;
    ...

    function voiceCommand(command) {

    
        command = command.toLowerCase()
        .replace(commandReg, "")
        .replace(",", "");
    

    ...

    
    if (command.includes("change to") || command.includes("changeto"))
     {

    
        // Remove intention, isolate command
        command = command.replace("change", "")
        .replace("to", "")
        .replace(".", "")
        .replace(/ /g, '');
    

        switch (command) {
        case "gray":
                document.getElementById("sideNav").classList.remove('bg-primary');
                document.getElementById("sideNav").classList.add('gray');
                break;
            case "green":
            ...
        }
    }

    //or manipulate with javascript
    ...
    }

                

Ready to supercharge your app?

Convert audio to text, perform speech translation and text-to-speech with the unified Speech services

Thank You

Questions? Send us an email..

Dick van Straaten
dick.van.straaten@centric.eu