@alanmarth wrote:
I want to use SpeechRecognitionPlugin in my app:
https://github.com/macdonst/SpeechRecognitionPlugin
Since it isn't in ngCordova, I can't simply call the service, but the code to access it is:
<script type="text/javascript">
var recognition;
document.addEventListener('deviceready', onDeviceReady, false);function onDeviceReady() {
recognition = new SpeechRecognition();
recognition.onresult = function(event) {
if (event.results.length > 0) {
q.value = event.results[0][0].transcript;
q.form.submit();
}
}
}
</script>I know that I have to use a controller, I tried to wrap it in $ionicPlatform.ready, but still it doesn't work. It seems that I cant simply initialize the SpeechRecognition() object. What is the correct way to access to that object?
I found an js file inside puglin's folder that contains that object. It is declared as follows:
var exec = require("cordova/exec");
/**
attribute SpeechGrammarList grammars;
attribute DOMString lang;
attribute boolean continuous;
attribute boolean interimResults;
attribute unsigned long maxAlternatives;
attribute DOMString serviceURI;
*/
var SpeechRecognition = function () {....
module.exports = SpeechRecognition;
Script url: * alphalingo\plugins\org.apache.cordova.speech.speechrecognition\www*
Do I have to call that script from somewhere? Thank you guys.
Posts: 1
Participants: 1