Hello Support
I have been working on this and I am not sure how to make this work. If we can get this to work (by even you/Max making a webinar about it) I am sure it will benefit all Appery developers. I have read through all the posts on the forum on this subject and also watch the your you tube video” Installing and Using 3rd-party Cordova Plug ins with Appery.io” and this is what I have completed so far (IOS)
I went to https://github.com/macdonst/SpeechRec... and downloaded the zip file
Created a new project and clicked on the source tab
Go to iOS Resources www project files resources lib plugins:
Create a new folder under the plugins folder with the following name - org.apache.cordova.speech
Click “Upload to this folder” to the right of the just-created folder. Upload the SpeechRecognition.js file in the SpeechRecognitionPlugin-master\www of earlier downloaded lib.
Please note I will add these files later
SpeechRecognitionError.js
SpeechRecognitionAlternative.js
SpeechRecognitionResult.js
SpeechRecognitionResultList.js
SpeechRecognitionEvent.js
SpeechGrammar.js
SpeechGrammarList.jsOpen the SpeechRecognition.js file. Add the following string to the very beginning of the file: cordova.define("org.apache.cordova.speech", function(require, exports, module) {
And the following strings to the very end of file:
var SpeechRecognition = new SpeechRecognition();
module.exports = SpeechRecognition;
});Open the cordova_plugins.js (in lib folder). Add the following code in the very end of this file:
,
{
"file": "plugins/org.apache.cordova.speech/SpeechRecognition.js",
"id": "org.apache.cordova.speech.SpeechRecognition",
"clobbers": ["SpeechRecognition"]
}Go to config.xml and add the following code:
Code: Select all
param name="ios-package" value="SpeechRecognition"
Go to Plugins. Create a folder with following name – org.apache.cordova.speech:
upload to the org.apache.cordova.speech folder
ISSpeechRecognition.h
ISSpeechRecognitionLocales.h
iSpeechSDK.h
ISSpeechRecognitionResult.h
ISSpeechSynthesis.h
ISSpeechSynthesisVoices.h
SpeechRecognition.h
SpeechRecognition.mclicked on the Project tab
Add a Button on the App
On a click event run the following javascript
SpeechRecognition.recognition.start();
var recognition = new SpeechRecognition();
recognition.onresult = function(event) {
if (event.results.length 0) {
q.value = event.results[0][0].transcript;
q.form.submit();
}
};That’s it and I am getting an error on the browser tester
Uncaught ReferenceError: SpeechRecognition is not definedSpeech.js:116 Speech_elementsEvents.$.off.on.clickjquery
jQuery.event.dispatch
elemData.handleSo I am not sure what I’ve done correct or incorrect
Can you help?