• Stars
    star
    188
  • Rank 205,563 (Top 5 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

W3C Web Speech API - Speech Recognition plugin for PhoneGap

SpeechRecognitionPlugin

W3C Web Speech API - Speech Recognition plugin for PhoneGap

Update 2013/09/05

Back to work on this but it's not ready yet so don't try to use.

Update 2013/08/05

Hi, you are all probably wondering where the code is after seeing my PhoneGap Day US presentation or reading the slides. Well, I've been dealing with an illness in the family and have not has as much spare time as I would have hoped to update this project. However, things are working out better than I could have hoped for and I should have time to concentrate on this very soon.

Update 2015/04/04

Basic example is working on iOS and android

<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>
<form action="http://www.example.com/search">
    <input type="search" id="q" name="q" size=60>
    <input type="button" value="Click to Speak" onclick="recognition.start()">
</form>

Example from section 6.1 Speech Recognition Examples of the W3C page (https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#examples)

To install the plugin use

cordova plugin add https://github.com/macdonst/SpeechRecognitionPlugin

Since iOS 10 it's mandatory to add a NSMicrophoneUsageDescription in the info.plist to access the microphone.

To add this entry you can pass the MICROPHONE_USAGE_DESCRIPTION variable on plugin install.

Example:

cordova plugin add https://github.com/macdonst/SpeechRecognitionPlugin --variable MICROPHONE_USAGE_DESCRIPTION="your usage message"

If the variable is not provided it will use an empty message, but a usage description string is mandatory to submit your app to the Apple Store.

On iOS 10 and greater it uses the native SFSpeechRecognizer (same as Siri).

Supported locales for SFSpeechRecognizer are: ro-RO, en-IN, he-IL, tr-TR, en-NZ, sv-SE, fr-BE, it-CH, de-CH, pl-PL, pt-PT, uk-UA, fi-FI, vi-VN, ar-SA, zh-TW, es-ES, en-GB, yue-CN, th-TH, en-ID, ja-JP, en-SA, en-AE, da-DK, fr-FR, sk-SK, de-AT, ms-MY, hu-HU, ca-ES, ko-KR, fr-CH, nb-NO, en-AU, el-GR, ru-RU, zh-CN, en-US, en-IE, nl-BE, es-CO, pt-BR, es-US, hr-HR, fr-CA, zh-HK, es-MX, id-ID, it-IT, nl-NL, cs-CZ, en-ZA, es-CL, en-PH, en-CA, en-SG, de-DE

Two-character codes can be used too.

On iOS 9 and older it uses iSpeech SDK, an API key is required, get one on https://www.ispeech.org/, it's free. To provide the key, add this preference inside the config.xml

 <preference name="apiKey" value="yourApiKeyHere" />

If none is provided it will use the demo key "developerdemokeydeveloperdemokey"

iSpeech supported languages are:

English (Canada) (en-CA) English (United States) (en-US) Spanish (Spain) (es-ES) French (France) (fr-FR) Italian (Italy) (it-IT) Polish (Poland) (pl-PL) Portuguese (Portugal) (pt-PT)

Two-character codes can be used too, but for English, "en" will use "en-US"

More Repositories

1

VideoPlayer

Java
149
star
2

SpeechSynthesisPlugin

W3C Web Speech API - Speech synthesis plugin for PhoneGap
Java
69
star
3

TelephoneNumberPlugin

Java
67
star
4

TTS

Java
27
star
5

push-workshop

PhoneGap Day US 2016 workshop - Simple mobile application built showing how to handle various push notifications
CSS
27
star
6

AppPreferences

Java
22
star
7

corinthian

Provide some common UI elements to Apache Cordova Android applications.
Java
16
star
8

js-naked-day.org

HTML
12
star
9

anna

Demo application for Speech Rec on Android
JavaScript
10
star
10

CordovaAndroidUI

HTML based UI components integrated with Apache Cordova
JavaScript
9
star
11

FtpClient

Java
9
star
12

IMEI

Java
7
star
13

Ottawa-JavaScript-PhoneGap

Slides for my presentation on June 12th
Objective-C
6
star
14

GPS-Weather

An example PhoneGap project that determines the weather at your current location.
JavaScript
5
star
15

cordova-plugin-allow-backup

To enable you to set the allowBackup property of a cordova-android application
5
star
16

SpeechShim

Shim's the webkitSpeechRecognition to W3C proposed SpeechRecognition interface
JavaScript
4
star
17

callback-blackberry

Java
4
star
18

GalleryPlugin

Add an image to the Android Gallery
Java
4
star
19

Ottawa-JavaScript-SpeechRec

My presentation on Speech Rec in the browser from January 9th, 2013
JavaScript
4
star
20

callback-qt

C++
3
star
21

tabata

Tabata Timer PWA using React
JavaScript
2
star
22

phonegap-js

JavaScript
2
star
23

Unplugg

Android application to turn off wireless, bluetooth, etc. at set times to save battery and get work done.
JavaScript
2
star
24

callback-mac

Objective-C
2
star
25

yowdev

2
star
26

callback-ios

Objective-C
2
star
27

callback-webos

JavaScript
2
star
28

callback-windows-phone

JavaScript
2
star
29

callback-docs

Ruby
1
star
30

AlgonquinMobileX4

PDF and code from my Algonquin MobileX4 presentation February 21st, 2012
JavaScript
1
star
31

submit-fallback

JavaScript
1
star
32

enhance-todomvc

CSS
1
star
33

callback-test

JavaScript
1
star
34

enhance-workshop-codemash

JavaScript
1
star
35

bookrecs-org

JavaScript
1
star
36

begin-redis-app

Begin app
JavaScript
1
star
37

Remember-Apache-Answers

Rembers the answers to Apache's Wiki CATCHPA's so you don't have to look them up
JavaScript
1
star
38

enhance-blog-template

JavaScript
1
star
39

callback-weinre

Java
1
star
40

pluginpub

JavaScript
1
star
41

summit-phonegap-supercharge

CSS
1
star
42

cordova-plugin-compat

Java
1
star
43

simple-image-server

Hapi service that returns images for a demo
JavaScript
1
star
44

callback-bada

JavaScript
1
star
45

plugins

PhoneGap plugins
1
star