GithubHelp home page GithubHelp logo

neuralnoise / titanium-android-voicerecognition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mumumu/titanium-android-voicerecognition

0.0 2.0 0.0 262 KB

Titanium Module for Voice Recognition on Android.

License: Other

JavaScript 15.29% Java 84.71%

titanium-android-voicerecognition's Introduction

Titanium Module for Voice Recognition on Android.

Description

Titanium Module for Voice Recognition on Android.

In nature, we can write Voice Recognition routine by the following blog entry, but the code in this entry did not work in Android 2.x and Titanium 2.0.1GA environment. This is because "Ti.Android.currentActivity.startActivityForResult" function does not call callback function correctly.

http://www.matthuggins.com/articles/android-voice-recognition-in-appcelerator-titanium

Using this module, we can get Voice Recognition result correctly on Android 2.x, 3.x, 4.0.3, 4.2

Requirement

Android min-sdk: Android 2.2 (API Level 8)
Titanium 2.1.2GA or later

Supported Architecture

  • ARM (armeabi-v7a)
  • Intel x86 (experimental. If you send me a test report, I will highly appriciated)

Accessing the voicerecognition Module

To access this module from JavaScript, you would do the following:

var voicerecognition = require("org.mumumu.ti.android.speech");

The voicerecognition variable is a reference to the Module object.

Usage

O) download repository archive from this site.

A) place dist/org.mumumu.ti.android.speech-android-0.3.zip to your Titanium project root.

B) add the following setting to tiapp.xml between <ti:app> tag.

<modules>
    <module version="0.3">org.mumumu.ti.android.speech</module>
</modules>

C) Invoke the module code.

if (Ti.Platform.name == "android") {
    var speechModule = require('org.mumumu.ti.android.speech');
    var voiceRecognitionProxy = speechModule.createVoiceRecognition();
    var callback_func = function (e) {
        var voice_recognition_enabled = e.voice_enabled;
        var voice_results = e.voice_results;
        if (e.voice_canceled) {
            alert("voice recognition canceled");
        } else {
            if (!voice_recognition_enabled) {
                alert("voice recognition seems to be disabled");
            } else {
                alert(voice_results[0]); //  array.
            }
        }
    };
    voiceRecognitionProxy.voiceRecognition({
        "android.speech.extra.PROMPT": "please say something",
        "android.speech.extra.LANGUAGE_MODEL": "free_form",
        "callback": callback_func
    });
}

Author

Yoshinari Takaoka (reversethis -> gro tod umumum ta umumum)

License

BSD License. See License.txt for details.

titanium-android-voicerecognition's People

Contributors

mumumu avatar isis avatar

Watchers

James Cloos avatar Starbuck avatar

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.