Google speech recognition returning wrong result when i speak something?












-1















I am currently implementing the speech to text application. It returns fine for English character but when i speak any word like "Twenty" it return "xx" in roman but i want it to be Twenty or 20. How can i do this?
Till now i have followed this.Is there any free library to convert speech to text.When i speak on google it also return twenty as "xx" but i need to resolve this issue. So please anyone help me in it.



  speech = SpeechRecognizer.createSpeechRecognizer(this);
speech.setRecognitionListener(this);
recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); recognizerIntent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS, 10000);
recognizerIntent.putExtra("android.speech.extra.DICTATION_MODE", true);
speech.startListening(recognizerIntent);

@Override
public void onBeginningOfSpeech() {
Log.d("Log", "onBeginningOfSpeech");
}

@Override
public void onBufferReceived(byte buffer) {
Log.d("Log", "onBufferReceived: " + buffer);
}

@Override
public void onEndOfSpeech() {
Log.d("Log", "onEndOfSpeech");
}

@Override
public void onError(int errorCode) {
String errorMessage = getErrorText(errorCode);
Log.d("Log", "FAILED " + errorMessage);
speek_text.setText(errorMessage);
goToLandingActivity();
}

@Override
public void onEvent(int arg0, Bundle arg1) {
Log.d("Log", "onEvent");
}

@Override
public void onPartialResults(Bundle arg0) {
Log.d("Log", "onPartialResults");

ArrayList<String> matches = arg0.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
String text = "";
/* To get all close matchs
for (String result : matches)
{
text += result + "n";
}
*/
text = matches.get(0); // Remove this line while uncommenting above codes
speek_text.setText(text);
goToLandingActivity();

}

@Override
public void onReadyForSpeech(Bundle arg0) {
Log.d("Log", "onReadyForSpeech");
}

@Override
public void onResults(Bundle results) {
Log.d("Log", "onResults");

}

@Override
public void onRmsChanged(float rmsdB) {
Log.d("Log", "onRmsChanged: " + rmsdB);

}









share|improve this question



























    -1















    I am currently implementing the speech to text application. It returns fine for English character but when i speak any word like "Twenty" it return "xx" in roman but i want it to be Twenty or 20. How can i do this?
    Till now i have followed this.Is there any free library to convert speech to text.When i speak on google it also return twenty as "xx" but i need to resolve this issue. So please anyone help me in it.



      speech = SpeechRecognizer.createSpeechRecognizer(this);
    speech.setRecognitionListener(this);
    recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); recognizerIntent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS, 10000);
    recognizerIntent.putExtra("android.speech.extra.DICTATION_MODE", true);
    speech.startListening(recognizerIntent);

    @Override
    public void onBeginningOfSpeech() {
    Log.d("Log", "onBeginningOfSpeech");
    }

    @Override
    public void onBufferReceived(byte buffer) {
    Log.d("Log", "onBufferReceived: " + buffer);
    }

    @Override
    public void onEndOfSpeech() {
    Log.d("Log", "onEndOfSpeech");
    }

    @Override
    public void onError(int errorCode) {
    String errorMessage = getErrorText(errorCode);
    Log.d("Log", "FAILED " + errorMessage);
    speek_text.setText(errorMessage);
    goToLandingActivity();
    }

    @Override
    public void onEvent(int arg0, Bundle arg1) {
    Log.d("Log", "onEvent");
    }

    @Override
    public void onPartialResults(Bundle arg0) {
    Log.d("Log", "onPartialResults");

    ArrayList<String> matches = arg0.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
    String text = "";
    /* To get all close matchs
    for (String result : matches)
    {
    text += result + "n";
    }
    */
    text = matches.get(0); // Remove this line while uncommenting above codes
    speek_text.setText(text);
    goToLandingActivity();

    }

    @Override
    public void onReadyForSpeech(Bundle arg0) {
    Log.d("Log", "onReadyForSpeech");
    }

    @Override
    public void onResults(Bundle results) {
    Log.d("Log", "onResults");

    }

    @Override
    public void onRmsChanged(float rmsdB) {
    Log.d("Log", "onRmsChanged: " + rmsdB);

    }









    share|improve this question

























      -1












      -1








      -1








      I am currently implementing the speech to text application. It returns fine for English character but when i speak any word like "Twenty" it return "xx" in roman but i want it to be Twenty or 20. How can i do this?
      Till now i have followed this.Is there any free library to convert speech to text.When i speak on google it also return twenty as "xx" but i need to resolve this issue. So please anyone help me in it.



        speech = SpeechRecognizer.createSpeechRecognizer(this);
      speech.setRecognitionListener(this);
      recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
      recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
      recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); recognizerIntent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS, 10000);
      recognizerIntent.putExtra("android.speech.extra.DICTATION_MODE", true);
      speech.startListening(recognizerIntent);

      @Override
      public void onBeginningOfSpeech() {
      Log.d("Log", "onBeginningOfSpeech");
      }

      @Override
      public void onBufferReceived(byte buffer) {
      Log.d("Log", "onBufferReceived: " + buffer);
      }

      @Override
      public void onEndOfSpeech() {
      Log.d("Log", "onEndOfSpeech");
      }

      @Override
      public void onError(int errorCode) {
      String errorMessage = getErrorText(errorCode);
      Log.d("Log", "FAILED " + errorMessage);
      speek_text.setText(errorMessage);
      goToLandingActivity();
      }

      @Override
      public void onEvent(int arg0, Bundle arg1) {
      Log.d("Log", "onEvent");
      }

      @Override
      public void onPartialResults(Bundle arg0) {
      Log.d("Log", "onPartialResults");

      ArrayList<String> matches = arg0.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
      String text = "";
      /* To get all close matchs
      for (String result : matches)
      {
      text += result + "n";
      }
      */
      text = matches.get(0); // Remove this line while uncommenting above codes
      speek_text.setText(text);
      goToLandingActivity();

      }

      @Override
      public void onReadyForSpeech(Bundle arg0) {
      Log.d("Log", "onReadyForSpeech");
      }

      @Override
      public void onResults(Bundle results) {
      Log.d("Log", "onResults");

      }

      @Override
      public void onRmsChanged(float rmsdB) {
      Log.d("Log", "onRmsChanged: " + rmsdB);

      }









      share|improve this question














      I am currently implementing the speech to text application. It returns fine for English character but when i speak any word like "Twenty" it return "xx" in roman but i want it to be Twenty or 20. How can i do this?
      Till now i have followed this.Is there any free library to convert speech to text.When i speak on google it also return twenty as "xx" but i need to resolve this issue. So please anyone help me in it.



        speech = SpeechRecognizer.createSpeechRecognizer(this);
      speech.setRecognitionListener(this);
      recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
      recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
      recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault()); recognizerIntent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS, 10000);
      recognizerIntent.putExtra("android.speech.extra.DICTATION_MODE", true);
      speech.startListening(recognizerIntent);

      @Override
      public void onBeginningOfSpeech() {
      Log.d("Log", "onBeginningOfSpeech");
      }

      @Override
      public void onBufferReceived(byte buffer) {
      Log.d("Log", "onBufferReceived: " + buffer);
      }

      @Override
      public void onEndOfSpeech() {
      Log.d("Log", "onEndOfSpeech");
      }

      @Override
      public void onError(int errorCode) {
      String errorMessage = getErrorText(errorCode);
      Log.d("Log", "FAILED " + errorMessage);
      speek_text.setText(errorMessage);
      goToLandingActivity();
      }

      @Override
      public void onEvent(int arg0, Bundle arg1) {
      Log.d("Log", "onEvent");
      }

      @Override
      public void onPartialResults(Bundle arg0) {
      Log.d("Log", "onPartialResults");

      ArrayList<String> matches = arg0.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
      String text = "";
      /* To get all close matchs
      for (String result : matches)
      {
      text += result + "n";
      }
      */
      text = matches.get(0); // Remove this line while uncommenting above codes
      speek_text.setText(text);
      goToLandingActivity();

      }

      @Override
      public void onReadyForSpeech(Bundle arg0) {
      Log.d("Log", "onReadyForSpeech");
      }

      @Override
      public void onResults(Bundle results) {
      Log.d("Log", "onResults");

      }

      @Override
      public void onRmsChanged(float rmsdB) {
      Log.d("Log", "onRmsChanged: " + rmsdB);

      }






      android speech-to-text






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 19 at 8:55









      Rishikesh RahiRishikesh Rahi

      35




      35
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54265502%2fgoogle-speech-recognition-returning-wrong-result-when-i-speak-something%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54265502%2fgoogle-speech-recognition-returning-wrong-result-when-i-speak-something%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Callistus III

          Ostreoida

          Plistias Cous