3

I am looking to add speech recognition to a Cordova-based app. It appears that window.webkitSpeechRecognition is undefined for both iOS and Android applications.

I am able to use webkitSpeechRecognition within standard Chrome on the Android device, but it does not work when packaged with Cordova.

Is there a way to enable webkitSpeechRecognition or something comparable on iOS and/or Android?

SMR
  • 6,628
  • 2
  • 35
  • 56
Nathan Voxland
  • 15,453
  • 2
  • 48
  • 64

1 Answers1

1

Not really a Cordova feature but UIWebView and WebView underlying WebKits. According tohttp://caniuse.com/#search=web%20speech it seems that the API is not supported on Android (I would double check that) and is partially supported on iOS but the API name is prefixed with webkit

momo
  • 3,404
  • 6
  • 37
  • 66
  • I think iOS only supports the Text to Speech part, not the speech recognition – jcesarmobile Nov 19 '14 at 07:25
  • Yes, the feature is outside of Cordova, but it doesn't work in Cordova vs. the standard chrome browser. I'm using Cordova on Android 4.4 which should be using Chrome as the basis of UIWebView. The Chrome version used may be different than the stand-alone browser, however. – Nathan Voxland Nov 19 '14 at 07:25
  • 1
    It looks like on Android WebView, Chrome is version 30.0.0.0 as of Android 4.4.2. SpeechRecognition is not available until Chrome 31 http://blog.chromium.org/2013/10/chrome-31-beta-android-application.html so that is the problem with Android. Android 4.4.3 and 5.0 support Chrome 33 and 36 respectively so they may work, I will have to test them. https://developer.chrome.com/multidevice/webview/overview – Nathan Voxland Nov 19 '14 at 07:32
  • 1
    According to caniuse.com, Mobile Safari only supports text-to-speech, not speech-to-text at this point. – Nathan Voxland Nov 19 '14 at 07:33
  • I just did a quick test on a iOS Cordova app and the speech recognition doesn't appear to work. Is my understanding the UIWebview should be the same as the Safari version. In the case of Android I don't think that's the case (I would guess the Chromium webkit version comes with the OS as opposed to the upgradeable Chrome app). I wish you luck on this, I believe it won't be easy to get something working :-/ – momo Nov 19 '14 at 07:34
  • as you are using cordova, you can use speech recongition plugins, search them on github – jcesarmobile Nov 19 '14 at 07:35