Git Product home page Git Product logo

cordova-plugin-speechrecognition's People

Contributors

akume avatar cveniamin avatar janpio avatar pbakondy avatar simone-compagnone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-speechrecognition's Issues

error domain=kAFAssistantErrorDomain Code=1101"(null)"

Hi Peter,
I am using your plugin in cordova app,it give me error on simulator(error domain=kAFAssitantErrorDomainCode=1101"(null)")
and says missing permission in isListening function.
Also in device it give me error(error domain=kAFAssitantErrorDomainCode=216"(null)").

Kindly help.
Thanks in advance

iOS - AVAudioSessionCategoryPlayAndRecord does not work

Once startListening() fires, there is no sound, even after stopListening(). Before that, anything is ok.
Does anyone knows something about it?
I also tryied to remove cordova-plugin-avaudiosession but nothing changed.

Allow using google speech for Apple devices

It should be possible to use google speech recognition api on Apple devices instead of native / apple apis.

Specifically, under HIPAA requirement we can use google speech api, while we can't use apple services.

How to use this plugin with Ionic 2?

i am new to ionic i want to use your plugin with ionic 2 but unable to do so as there is no type definition included it tried many solutions e.g declare var SpeechRecognition:any; for calling the function but it's not recognizing them.

Really Sorry i know it's not the issue with your plugin but i am unable to find the solution i don't know where to ask so i am writing here.

Please help me i would be very thankful and please also update guide on your plugin too for ionic 2 it would help a lot of other peoples too thanks looking forward for your positive reply.

hide android popup

hi i wanna ask you how can i remove android popup same like ios so i can use my own design.

Always return error

I don't know what is wrong but it always return error to me after recognition with no matches message.
Any help is appreciated thanks.

i figured out that it requires network to work.

ios-10 not working speech recognition

I add the plugin to app and build for ios platform with ionic v1. I getting error while to build. please help me for error code while to start button . (this device firmware: IOS 10.3.3) Can someone help , please

2017-08-15 15:17:28.652580+0300 speech[1243:266907] startListening()
2017-08-15 15:17:28.811608+0300 speech[1243:266907] THREAD WARNING: ['SpeechRecognition'] took '158.988037' ms. Plugin should use a background thread.
2017-08-15 15:18:32.519156+0300 speech[1243:266907] startListening() recognitionTask error: Error Domain=kAFAssistantErrorDomain Code=203 "Retry" UserInfo={NSLocalizedDescription=Retry, NSUnderlyingError=0x170250da0 {Error Domain=SiriSpeechErrorDomain Code=1 "(null)"}}
2017-08-15 15:18:32.528613+0300 speech[1243:266907] ERROR: Error Domain=kAFAssistantErrorDomain Code=203 "Retry" UserInfo={NSLocalizedDescription=Retry, NSUnderlyingError=0x170250da0 {Error Domain=SiriSpeechErrorDomain Code=1 "(null)"}}

Ionic 2.3.0 with Native 3+, getting "plugin-not-installed" error

Hi,

I just tried this plugin with Ionic 2.3 and Ionic Native 3, when I use the available function to check whether it is supported, I got "plugin-not-installed" error.

I followed the plugin installation instruction from Ionic docs here and configured it following instruction here

I am using Ionic View app to test my app.

My system info:

Cordova CLI: 6.5.0 
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.9
Node Version: v6.10.0
Xcode version: Not installed

Thank you for your help!

IOS App freezes at finished loading the index page after installation of the plugin

My app can run normally before. However the app froze at at finished loading of index page after installation of the plugin. Permission granted.

I didn't change any coding and have not yet initialized nor called the plugin, no error message in console.

Angular project
cordova version 6.4.0
cordova platform version - ios 3.9.1
ios 10.2.1

Error Details are not found.

I have added onresult and onerror event listener to my SpeechRecognition object.
onresult callback is working fine but onerror is not.

when a onerror event fires, "event" object has only one information ["type":"error"].
There is no error details or message available.

Problem with Samsung SM-T235 tablet

First of all: big thanks for this plugin!
I have implemented this plugin successfully in my hybrid app project..It is working well on my iphone 6 and xiaomi redmi smartphones.
I have problem if i want to run my app on the Samsung SM-T235 tablet (Android version 5.1.1) ..I don't receive any error message, just the whole Phonegap library is not working. Without this plugin everything is fine.
I use the Phonegap Build Service (cli-6.5.0).
Any suggestions would be appreciated!

Error on No speech.

When i run startlistening, and stopping it without recording/speaking it produces error. Is this a correct behaviour ?

Starting again the recognition fails on Android

I have problem of ERROR_RECOGNIZER_BUSY or prompt paused on "Try again" once I got my first results and I call .startListening() again. I am using Ionic 2, but it is exactly the same using directly the cordova plugin.

I think you should manage better this kind of errors, here is what I found to solve this kind of issues :
https://stackoverflow.com/questions/13227105/speechrecognizer-not-connected-to-recognition-service
https://stackoverflow.com/questions/15759676/handling-recognitionlistener-errors

I would do :

sr.stopListening();
sr.cancel();
sr.destroy();
sr.startListening();

to be sure all is back again

For the moment, my work is stuck. no other workaround found

Offline Speech Recognition

Hi,

Do you know if it's possible use the offline speech recognition on both platforms (android and ios)?

I read the documentation and I saw this plugin uses the online speech recognition APIs, so I want to know if you know another plugin, or even know if ios and android offers the offline api to thirty party apps.

Thanks.

Speech/Speech.h file not found

Hello im getting an error in ios when i build it. the error is Speech/Speech.h file not found where can I find the speech.h? or the file of speech/speech.h?

Full example request - from click to text injection back to the page

Hi
I am fascinated with Cordova features. Now I want to add text recognition to my app. But current example is very unclear. I ask you to create simple but complete example (like those on Cordova home page) witch will show recognition process from click on button on web page to recognized text injection to some edit box. This will be great and will show strength both Cordova and yours. Maybe it is silly task, but challenge for beginner...

thank you and best regards
Jacek

Cordova iOS build is failed

I did try to test your plugin (i waiting for similar long time ago), but build is failed with the following error:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_SFSpeechAudioBufferRecognitionRequest", referenced from:
      objc-class-ref in SpeechRecognition.o
  "_OBJC_CLASS_$_SFSpeechRecognizer", referenced from:
      objc-class-ref in SpeechRecognition.o
ld: symbol(s) not found for architecture i386

It's a simple Phonegap project, contains only this plugin. When i remove plugin, then project files compiled fine. What solutions are possible to solve this issue?

*** UPDATE ***
Cordova and Xcode re-install solved the problem, sorry.

“Network error” on startListening() Android 6/7

When I run the code below, as soon as the beep sounds to start recording the mic, I get "Network error":

I have no idea what's wrong here. I've:

  • added the: cordova plugin + npm module correctly,
  • granted permissions in the app for microphone
  • tried connected to WIfi
  • tried connected to 4g
  • tried removing and re-adding the android platform to the project
  • tried on 2 different phones (samsung s5 android 6 / sony xperia z5c android 7)

Here's my basic code, nothing special here:

  setupSpeechRecognition() {
    this.speechRecognition.requestPermission().then(() => {
        this.speechRecognition.startListening().subscribe(
            (matches) => {
              // matches here...
            },
            (onerror) => {
              alert("Error: " + JSON.stringify(onerror));
            }
        );          
      },
      () => {}
    );      
  }

And here's my AndroidManifest.xml for kicks:

<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="io.ionic.starter" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@mipmap/icon" android:label="@string/app_name" android:supportsRtl="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver android:name="cordova.plugins.Diagnostic$LocationProviderChangedReceiver">
            <intent-filter>
                <action android:name="android.location.PROVIDERS_CHANGED" />
            </intent-filter>
        </receiver>
        <receiver android:name="cordova.plugins.Diagnostic$NFCStateChangedReceiver">
            <intent-filter>
                <action android:name="android.nfc.action.ADAPTER_STATE_CHANGED" />
            </intent-filter>
        </receiver>
    </application>
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="25" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

Any ideas?

Thanks.

Disable "beep" sound on start and stop

Hi
is there any way to disable the beep sound on starting and stopping ?
I'm using Ionic 2 and building for Android.

I tried Media Plugin but it does not seem to be able to affect system sounds.

Thanks in advance.

Working example app for testing

Do you have a full working example app, ideally on an app store, that we can use to test how well the speech recognition works without having to build one? It would also be very helpful (and there's already an issue for this) to have full code for a simple working example (maybe using a voice command) available.

Thanks very much.

java.lang.SecurityException on Android

I'm starting to get this error on Android 7.0, specifically on Galaxy S7 Edge.

java.lang.SecurityException: 
  at android.app.ContextImpl.bindServiceCommon (ContextImpl.java:1521)
  at android.app.ContextImpl.bindService (ContextImpl.java:1475)
  at android.content.ContextWrapper.bindService (ContextWrapper.java:688)
  at android.speech.SpeechRecognizer.startListening (SpeechRecognizer.java:287)
  at com.pbakondy.SpeechRecognition$2.run (SpeechRecognition.java:179)
  at android.os.Handler.handleCallback (Handler.java:751)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:154)
  at android.app.ActivityThread.main (ActivityThread.java:6692)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1468)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1358)

Anyone knows what might be the issue?

CDVPlugin error in xcode / ios

I installed this plugin and am seeing the following error in xcode when trying to compile and run the app for ios. Does anyone know what I can do to fix this?
CDVPlugin class SpeechRecognition (pluginName: SpeechRecognition) does not exist.
ERROR: Plugin 'SpeechRecognition' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.

I ran the following commands to install the plugin. Maybe I missed something?
sudo npm install ionic-native --save
sudo cordova plugin add cordova-plugin-speechrecognition

The plugin seems to work an android, I'm only having issues with ios.

Any help is appreciated.

showPopup: false - no match in Android 6.x

Option showPopup: false causes errors in Android 6.
First use is OK - I get list of matches, but the second and every next try - it fails.
There is an immediate response: No match (it's not even waiting for me to stop talking).
Few times there was also RecognitionService busy info.

With showPopup: true everything works just fine.

On Android 5 everything works fine in both cases. I was trying en-US and pl-PL.

I use the newest version of the plugin and Cordova.
Android 6 - Samsug Galaxy A5 model 2016 - Android 6.0.1
Android 5 - Samsung Galaxy S4 - Android 5.0.1

Doesnt request permission on iPhone 5S

Never calls callbacks in requestPermission. No output in console. iOS.
It is NOT depended of
'NSMicrophoneUsageDescription permission'
'NSSpeechRecognitionUsageDescription permission'
in my .plist file.

window.plugins.speechRecognition.requestPermission(function () {
// never
}, function () { // never })

DOES IT WORKS OFFLINE AND CONTINUOSLY

Hi,
Does speech recognition works continuously and offline also..
I was making one android app using cordova which has offline speech recognition capability and works continuously...
Also is there a way to implement "OK Google " like functionality which listens to some keyword and then starts the speech recognition..
Thanks.

My app which is use your plugin not gonna build under iOS with ionic cloud

I try to build my app which is use your SpeechRecognition plugin under iOS in Ionic cloud and get this error

"In file included from /Users/package/workspace/apps-25c2fea9-82/cordova/platforms/ios/CargoMessenger/Plugins/cordova-plugin-speechrecognition/SpeechRecognition.m:5:
/Users/package/workspace/apps-25c2fea9-82/cordova/platforms/ios/CargoMessenger/Plugins/cordova-plugin-speechrecognition/SpeechRecognition.h:2:9: fatal error: 'Speech/Speech.h' file not found
** import Speech/Speech.h**
** ^**
1 error generated.

BUILD FAILED "

under Android everything work good.

This plugin introduced in ionic 2 documentation, so I want to understand something wrong with plugin itself or something wrong with build process

Android 7.0 does start listening

On Android 7.0 the speech recognition dialog opens, however immediately stops and says try again and will not start listening. On iOS10 it works fine.

Tested with an empty Cordova "Hello World" app and the example code.

Phonegap build

I am getting this issue on phonegap for the IOS build:

The following 3rd-party plugin is causing the build to fail and may need to be updated to a newer version: cordova-plugin-speechrecognition

The android build works.

My config.xml file in my ionic app has this line:
<gap:plugin name="cordova-plugin-speechrecognition" source="npm" />

Not recognizing the Words

I try to show the recognized Words with this code:

// Handle results
					function startRecognition(){
						
						window.plugins.speechRecognition.startListening(function(result){
							// Show results in the console
							console.log(result);
						
						}, function(err){
							console.error(err);
						}, {
							language: "de-DE",
							showPopup: true
						});
						
					}

It is asking for Permission (so other code is working) and everything is okay, but the only result I get is:

Ongoing speech recognition

Why does not he show the words I have spoken? Has it perhaps to do with the matches? Is there an example? How is the right code to show the spoken results into the console.log?

Android unwanted "tap tp speak" popup

On Android, with the option showPopup=true, Google's "microphone on" popup shows correctly. But after speech ends, another popup, that says "tap to speak" shows for a moment (as though it were behind the first popup) and then goes away. It does not affect recognition, which works just fine. Is there any way to avoid the "tap to speak" popup?

startListening() not sure why it is not working

Hi
I have some problem with startListening() - it doesnt work.
My code:
`window.plugins.speechRecognition.isRecognitionAvailable(
function(){

        window.plugins.speechRecognition.hasPermission(
            function(){
                alert("hello")
                
                /*window.plugins.speechRecognition.startListening(
                    function(){
                        alert("recorded");
                    }, 
                    function(errorMsg){
                        alert(errorMsg);
                    }, 
                    {
                      String language = window.navigator.language,
                      Number matches = 1,
                      String prompt = "",      // Android only
                      Boolean showPopup = false,  // Android only
                    });*/
            }, 
            function(){alert("App doesn't have permissions granted.");});

    },
    function(){alert("Somethign went wrong.");}
);`

RIght now "hello" alert pops up before the recording" page is loaded - my first cordova project,
and if I uncomment startListening() the popup doesnt show up at all and nothing happens.

This code should run after pushing a button in "home_page" but after loading "add_page". Am i also not sure if Function successCallback should be function(result){ //result = array ?}. I would really apprecieate help or working example.

Thanks

Accuracy - can it be tweaked?

Hi,
I have previously used Web Speech API but since I don't know how to make it work on cordova android i have tried this plugin. It all works great but for some reason it recognizes English words despite language being set to pl-PL. eg "Raz dwa" (one two) is sometimes recognized as "France 2". Is there any way of tweaking options?
Thanks!

Nothing happening

Im using this plugin on cordova.
I have this code:

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
alert("pronto");

window.plugins.speechRecognition.hasPermission(Function successCallback2, Function errorCallback)

}

function successCallback(){
alert("foi");
}
function errorCallback(){
alert("deu erro");
}

function successCallback2(){
alert("tem permissao");
let options = {
String "pt-BR",
Number 5,
String "rola viado", // Android only
Boolean true
}
window.plugins.speechRecognition.startListening(Function successCallback, Function errorCallback, Object options)
}

Im using Android 7.1

startListening don't work on iOS 10

I implemented functions in this order and works ok on Android, but startListening doesn't works on iOS 10.

Functions
Avaliable - (works on android and iOS)
HasPermition - (works on android and iOS)
RequestPermition - (works on android and iOS)

But startListening - (works on android, but not works on iOS 10)

I already given permission on NSMicrophoneUsageDescription and
NSSpeechRecognitionUsageDescription with its string value in info.plist

I call permissions before i call startListening, but doesn´t works on iOS.

I am with:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.9.2
Xcode version: Xcode 8.2.1 Build version 8C1002

The erros that appears to me is --> error domain=kAFAssistantErrorDomain, same as others issues.

Can you have some idea why this is happen?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.