question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pronunciation assessment results missing in Android build (C# Unity)

See original GitHub issue

Hi all! I’m trying to implement pronunciation assessment in an Android Unity app, and have been unsuccessful in getting any pronunciation results from SpeechRecognitionEventArgs.

I was successful in getting pronunciation results when running on my Windows machine (within Unity Editor).

What could be causing this error?

Here is my RecognizedHandler code:

    private void RecognizedHandler(object sender, SpeechRecognitionEventArgs e)
    {
        
        if (e.Result.Reason == ResultReason.RecognizedSpeech)
        {

            pronunciationString = "";
            recognizedString = $"{e.Result.Text}";

            // Function is unable to progress from here on in Android build:
            var pronunciationResult = PronunciationAssessmentResult.FromResult(e.Result);
            
            pronunciationString += string.Format(
                "Accuracy score: {0}, Pronunciation score: {1}, Completeness score : {2}, FluencyScore: {3} \n",
                pronunciationResult.AccuracyScore, pronunciationResult.PronunciationScore,
                pronunciationResult.CompletenessScore, pronunciationResult.FluencyScore);
            pronunciationString += "\n Word level details \n";
            
            foreach (var word in pronunciationResult.Words)
            {
                pronunciationString += string.Format("Word: {0}, Accuracy score: {1}, Error type: {2}", word.Word,
                    word.AccuracyScore, word.ErrorType);
                
                foreach (var phoneme in word.Phonemes)
                {
                    pronunciationString += string.Format("Phoneme: {0}, Phoneme AccuracyScore: {1} \n",
                        phoneme.Phoneme, phoneme.AccuracyScore);
                }
            }
        }
        if (e.Result.Reason == ResultReason.NoMatch)
        {   
           Debug.Log($"NOMATCH: Speech could not be recognized.");
        }
    }

Any help will be much appreciated!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pankoponcommented, Jun 21, 2022

@yulin-li Any status update, or is the suggested workaround still the only way to go?

1reaction
yulin-licommented, Jan 11, 2022

Hi @aidenkoh801, sorry for the late reply. I am investigating the issue. Meanwhile, as a work around, you can parse the raw json string in your codes (using result.Properties.GetProperty(PropertyId.SpeechServiceResponse_JsonResult);)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unity does not see .so library in Android build
Here is the issue: I have a .so library with c++ functions, mark it for Android and Editor, put it into Assets/Plugins/Android folder,...
Read more >
What's new in Azure AI Speech?
Fix for getting Pronunciation Assessment results when PronunciationAssessmentGranularity.FullText is set (Customer issue) ...
Read more >
Unity build report is missing item in size calculation
I am building a project for both iOS and Android using Unity. While making file size adjustments I discovered the Build Report appears...
Read more >
TextView | Android Developers
Quickly bring your app to life with less code, using a modern declarative approach to UI, and the simplicity of Kotlin. ... Start...
Read more >
Android environment setup
To create a Unity application for Android, you first need to set up your Unity project to support Android. To support Android, a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found