GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hyperloop-modules/titanium-speech: Use the iOS 10 SFSpeechRecognizer API in JavaScript with Appcelerator Hyperloop.

BranchesTags
Open more actions menu

Latest commit

 

History

24 Commits
24 Commits

Folders and files

NameName
Last commit message
Last commit date
docs/api
docs/api
 
 
example
example
 
 
README.md
README.md
 
 
ti.speech.js
ti.speech.js
 
 

Repository files navigation

Ti.Speech

iOS 10 speech-recognition with Appcelerator Hyperloop.

Requirements

  • Titanium SDK 5.5.0.GA+
  • Hyperloop 2.0.0+
  • Xcode 8+
  • Include the following keys in the plist-section of your tiapp.xml:
<key>NSSpeechRecognitionUsageDescription</key>
<string>Can we parse your spoken words?</string>

<key>NSMicrophoneUsageDescription</key>
<string>Can we use the microphone for real-time speech recognition?</string>

Usage

Getting started using example app

  1. Copy example app from here: https://github.com/hyperloop-modules/ti.speech/tree/master/example
  2. Import app into your account using appc new --import
  3. Enable Hyperloop platform services when being asked
  4. Run the app with appc run -p ios -I 10.0

Creating a new app

  1. Create a new project with appc new -p ios
  2. Enable Hyperloop platform services when being asked
  3. Copy the ti.speech in your project and use code from examples (or example app)
  4. Run the app with appc run -p ios -I 10.0

Examples

You can use speech recognition with real-time audio or with pre-recorded media files (audio or video). See example file for more details.

Recognize from File URL

var TiSpeech = require("ti.speech");
TiSpeech.initialize("en_US");  // locale is optional

var win = Ti.UI.createWindow({
    backgroundColor: "#fff"
});

var btn = Ti.UI.createButton({
    title: "Recognize pre-recorded speech"
});

if (!TiSpeech.isSupported()) {
    alert("Speech recognition is not available on this device!");
    btn.setEnabled(false);
}

btn.addEventListener("click", function() {
    TiSpeech.recognize({
        type: TiSpeech.SOURCE_TYPE_URL, // optional, as it defaults to this if url is defined
        url: "one_more_thing.mp3",
        progress: function(e) {
            Ti.API.info(e.value);
        }
    });
});

win.add(btn);
win.open();

Recognize from Audio Input

var TiSpeech = require("ti.speech");
TiSpeech.initialize("en_US");  // locale is optional

var win = Ti.UI.createWindow({
    backgroundColor: "#fff"
});

var btn = Ti.UI.createButton({
    title: "Recognize real-time speech"
});

if (!TiSpeech.isAvailable()) {
    alert("Speech recognition is not available on this device!");
    btn.setEnabled(false);
}

btn.addEventListener("click", function() {
    TiSpeech.startRecognition({
        type: TiSpeech.SOURCE_TYPE_MICROPHONE, // optional, as it defaults to this if url is undefined		
        progress: function(e) {
            Ti.API.info(e.value);
        }
    });
});

win.add(btn);
win.open();

Author

  • Hans Knoechel (@hansemannnn)
  • Brenton House (@brentonhouse)

License

Apache 2.0

Contributing

Code contributions are greatly appreciated, please submit a new pull request!

About

Use the iOS 10 SFSpeechRecognizer API in JavaScript with Appcelerator Hyperloop.

Topics

appcelerator-hyperloophyperloopiosjavascriptnativespeech-recognition

Resources

Readme
Activity
Custom properties

Stars

22 stars

Watchers

5 watching

Forks

8 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.