Ionic 2 : An example of Speech Recognition on mobile phones

Vijay

Software Consultant

You may also like...

19 Responses

  1. SOLER says:

    Hi Vijay,

    Great Work.

    Do you have some idea how to make this code work on IOS?

    Can you help me with this?

  2. Vijay says:

    I didn’t test in IOS.

    There is already plugin included for ios which is in https://github.com/vijtad/SpeechRecognizer/tree/master/src/ios

    It uses ispeech sdk which is free but needs license for commercial products.

    My cordova plugin is an extension of https://github.com/macdonst/SpeechRecognitionPlugin whixh fixed memory leakage and other improvements in Java.

    My main aim of this article is to use offline speech recognition.

    Please let me know what issues you have in ios.

    Thanks,
    Vijay

  3. uma says:

    hii,
    when i run the app i am getting error like :
    cannot read start of undefined..

  4. sagar says:

    i followed your example but in ma case it says “Recognition is undefined”

  5. Vijay says:

    Did you run cordova plugin add https://github.com/vijtad/SpeechRecognizer ?

    This should initialize SpeechRecognizer.

  6. RONAN GUIMARAES KRAEMER says:

    Good Morning, I tryed this tutorial, but on my device noting happens when I tap the record button and on android emulator on pc its keeps crashing. Any idea what coud be?

    • Vijay says:

      I didn’t test on Android emulator. Not sure how to turn on microphone in emulator.

      I tested this on Android phone – Samsung 5 and Samsung 7.

      • RONAN GUIMARAES KRAEMER says:

        Yes, I testing in my phone too (motorola Moto-Play) whit the ionic view, but nothing is happening when I tap the button =/ (I’m really new in ionic projects)

        • Vijay says:

          Did you run cordova plugin successfully ?

          It will be better to put alerts in the code to check how far you are reaching.
          I think speech recognition is not initiated.

  7. It works fine on android. It is possible to have a continuous recognition? The recognition is stopped if nobody speaks. I’d like to listen in backgronnd and eventually start new operations if it finds a specific match.

    • Vijay says:

      Speech recognition is already running in continuous mode.
      May be you need to modify Cordova plugin Javascript or Java code to understand how/when speech recognition is stopped.

      Another solution would be to check for matching word and if not matched invoke the this.recognition.start(). Not sure whether this is a good solution as it takes sometime to reach listening mode.

  8. It works fine. Now how I can implement a continuous background recognition. I won’t that recognition stop.

    Thank you

  9. Monique says:

    For some reason it is working on my I-phone 6 but it will only print the message from the mic once (the platform.ready().then()) event )and then it displays blank messages for every recording after that. Any clue why this is?

    • Monique says:

      ionic2SpeechRecognizer[3492:888655] Started recognition.
      2017-04-30 17:40:49.688187 ionic2SpeechRecognizer[3492:888776] Speex finished
      2017-04-30 17:40:50.734203 ionic2SpeechRecognizer[3492:888655] Return in connectionDidFinishLoading
      2017-04-30 17:40:50.824083 ionic2SpeechRecognizer[3492:888655] Text: Hey how are you
      2017-04-30 17:40:55.889321 ionic2SpeechRecognizer[3492:888655] THREAD WARNING: [‘SpeechRecognition’] took ‘13.139160’ ms. Plugin should use a background thread.
      2017-04-30 17:40:55.960005 ionic2SpeechRecognizer[3492:888655] Started recognition.
      2017-04-30 17:41:00.803606 ionic2SpeechRecognizer[3492:888776] Speex finished
      2017-04-30 17:41:01.686008 ionic2SpeechRecognizer[3492:888655] Return in connectionDidFinishLoading
      2017-04-30 17:41:01.749038 ionic2SpeechRecognizer[3492:888655] Text:
      2017-04-30 17:41:45.289861 ionic2SpeechRecognizer[3492:888655] THREAD WARNING: [‘SpeechRecognition’] took ‘22.031250’ ms. Plugin should use a background thread.
      2017-04-30 17:41:45.402806 ionic2SpeechRecognizer[3492:888655] Started recognition.
      2017-04-30 17:41:49.139648 ionic2SpeechRecognizer[3492:888776] Speex finished
      2017-04-30 17:41:51.045892 ionic2SpeechRecognizer[3492:888655] Return in connectionDidFinishLoading
      2017-04-30 17:41:51.153353 ionic2SpeechRecognizer[3492:888655] Text:

      this is the console output

    • Vijay says:

      I didn’t test in iphone as this article is for Android device.

  10. Hi is it possible to Record and store the audio used in speech recognition process

  1. April 15, 2017

    […] Ionic 2 : An example of Speech Recognition on mobile phones […]

Leave a Reply

%d bloggers like this: