microsoft / cognitive-services-speech-sdk-js

Microsoft Azure Cognitive Services Speech SDK for JavaScript
Other
267 stars 101 forks source link

[Bug]: PronunciationAssessmentResult always return prosodyScore = 0 #838

Open Namnp1521 opened 5 months ago

Namnp1521 commented 5 months ago

What happened?

When i use Pronunciation Assessment, the result always have prosodyScore = 0

my code: `const speechConfig = sdk.SpeechConfig.fromSubscription( process.env.NEXT_PUBLIC_AZURE_KEY || '', process.env.NEXT_PUBLIC_AZURE_REGION || '' ); // setting the recognition language to English. speechConfig.speechRecognitionLanguage = 'en-US';

  // create the speech recognizer.
  const audioConfig = sdk.AudioConfig.fromDefaultMicrophoneInput();
  recoRef.current = new sdk.SpeechRecognizer(speechConfig, audioConfig);

  const reference_text = card.targetEntry[0];

  // create pronunciation assessment config, set grading system, granularity and if enable miscue based on your requirement.
  const pronunciationAssessmentConfig = new sdk.PronunciationAssessmentConfig(
    reference_text,
    sdk.PronunciationAssessmentGradingSystem.HundredMark,
    sdk.PronunciationAssessmentGranularity.Phoneme,
    true
  );
  pronunciationAssessmentConfig.enableProsodyAssessment = true;
  pronunciationAssessmentConfig.phonemeAlphabet = 'IPA';

  pronunciationAssessmentConfig.applyTo(recoRef.current);

  console.log(pronunciationAssessmentConfig);

  // nhan xet cau user doc
  function onRecognizedResult(result: sdk.SpeechRecognitionResult) {
    // setLoadingAzure(true);
    var pronunciation_result = sdk.PronunciationAssessmentResult.fromResult(result);

    console.log(pronunciation_result);
    setResult({
      detailResult: pronunciation_result.detailResult as any,
      accuracyScore: pronunciation_result.accuracyScore,
      fluencyScore: pronunciation_result.fluencyScore,
      completenessScore: pronunciation_result.completenessScore,
      prosodyScore: pronunciation_result.prosodyScore,
      pronunciationScore: pronunciation_result.pronunciationScore
    });
    // setLoadingAzure(false);
  }

  recoRef.current.recognizeOnceAsync(function (successfulResult) {
    onRecognizedResult(successfulResult);
  });`

the result: image

Version

1.36.0 (Latest)

What browser/platform are you seeing the problem on?

No response

Relevant log output

No response

jykim-tl commented 5 months ago

experiencing the same issue here.

version : 1.36.0 serviceRegion: 'eastus', language: 'en-US'


We've been using the sdk since March,2024 and had no change releated to the functions we're using Suddenly, experiencing the same issue described above since June 21, 2024.

But in our case, it does not happen all the time. It happens randomly.


We're comparing original sound file (pre-recorded, same every time) and recordings from people.