Page 1 of 2

Speech Recognition feature

Posted: Mon Apr 06, 2015 7:38 am
by Mark7294305

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)

  1. I went to https://github.com/macdonst/SpeechRec... and downloaded the zip file

  2. Created a new project and clicked on the source tab

  3. Go to iOS Resources www project files resources lib plugins:

  4. Create a new folder under the plugins folder with the following name - org.apache.cordova.speech

  5. 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.js

  6. Open 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;
    });

  7. 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"]
    }

  8. Go to config.xml and add the following code:

    Code: Select all

      param name="ios-package" value="SpeechRecognition"  
  1. Go to Plugins. Create a folder with following name – org.apache.cordova.speech:

  2. upload to the org.apache.cordova.speech folder
    ISSpeechRecognition.h
    ISSpeechRecognitionLocales.h
    iSpeechSDK.h
    ISSpeechRecognitionResult.h
    ISSpeechSynthesis.h
    ISSpeechSynthesisVoices.h
    SpeechRecognition.h
    SpeechRecognition.m

  3. clicked on the Project tab

  4. Add a Button on the App

  5. 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.handle

    So I am not sure what I’ve done correct or incorrect

    Can you help?


Speech Recognition feature

Posted: Mon Apr 06, 2015 7:48 am
by Evgene Karachevtsev

Hello Mark,

We'll pass your suggestion to our development team about the webinar, but unfortunately plugins are outside the scope of our support, so I can't guarantee this. By the way you missed the cope in p.8, could you please add it?


Speech Recognition feature

Posted: Mon Apr 06, 2015 7:52 am
by Mark7294305

I for to complete point 8. It should read

  1. Go to config.xml and add the following code:

    Code: Select all

     param name="ios-package" value="SpeechRecognition" 

Speech Recognition feature

Posted: Mon Apr 06, 2015 7:53 am
by Evgene Karachevtsev

Mark,

Please use tag precode <code>/code/pre


Speech Recognition feature

Posted: Mon Apr 06, 2015 7:54 am
by Mark7294305

I for to complete point 8. It should read

  1. Go to config.xml and add the following code:

    Code: Select all

     param name="ios-package" value="SpeechRecognition"  

Thanks

Mark


Speech Recognition feature

Posted: Mon Apr 06, 2015 7:56 am
by Mark7294305

I for to complete point 8. It should read

  1. Go to config.xml and add the following code:

    feature name="SpeechRecognition"
    param name="ios-package" value="SpeechRecognition"

    /feature

    Thanks


Speech Recognition feature

Posted: Mon Apr 06, 2015 8:06 am
by Evgene Karachevtsev

Mark,

Could you please put your code in tag pre<code>code/code/pre
precode</ code>/code/pre for we could be sure that it isn't corrupted by getsatisfaction?


Speech Recognition feature

Posted: Mon Apr 06, 2015 8:18 am
by Mark7294305
  1. Go to config.xml and add the following code:

    *** ***
    *** param name="ios-package" value="SpeechRecognition" ***
    *** ***
    *** ***

    Please delete "***" from each line


Speech Recognition feature

Posted: Mon Apr 06, 2015 8:20 am
by Mark7294305

Speech Recognition feature

Posted: Tue Apr 07, 2015 9:25 am
by Mark7294305

Hello Support
Thanks for your reply above but are you saying that your support cannot help me with this phonegap plugin or will you attempt to help but cannot guarantee a result?