Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23523] iOS10: Support Speech Recognition

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionDone
Resolution Date2016-12-11T12:56:00.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid, iOS
Labelsios10
ReporterHans Knöchel
AssigneeHans Knöchel
Created2016-06-14T19:57:30.000+0000
Updated2017-03-16T21:41:05.000+0000

Description

iOS 10 exposes APIs to parse the spoken language and return it as a textual output. We can support both local and remote URLs as well as real-time speech-recognition using the microphone. Proposed API:
var Speech = require("ti.speech");
var speechRecognizer = Speech.createSpeechRecognizer({
   type: Speech.RECOGNITION_TYPE_URL,
   locale: "en_US"
});

speechRecognizer.addEventListener("error", function(e)  {
    Ti.API.error("Speech recognition failed: " + e.error);
});

speechRecognizer.addEventListener("progress", function(e)  {
    Ti.API.error("New Speech recognition progress: " + e.result);
    Ti.API.warn("Number of transcriptions: " + e.transcriptions.length);
});

speechRecognizer.addEventListener("success", function(e)  {
    Ti.API.error("Speech recognition completed: " + e.result);
});

speechRecognizer.parse();

Comments

  1. Hans Knöchel 2016-06-21

    Thanks to [~bgrantges@appcelerator.com], Android also have a [SpeechRecognizer](https://developer.android.com/reference/android/speech/SpeechRecognizer.html) class we could use and actually the mapping could be achieved pretty good, since they both have progress events and a similar error handling. Thats why it should be done with Hyperloop - either as a module or as an example.
  2. Hans Knöchel 2016-12-11

    I made an open-source Hyperloop module that exposes this functionality: https://github.com/hansemannn/ti.speech
  3. Lee Morris 2017-03-16

    Can confirm that this was done.

JSON Source