ABCDEFGH
1
LocaleServiceAppUtteranceReplacementCommandArg1Notes
2
en:(launch|start) .*speech trigger{
"component": "ee.ioc.phon.android.speak/.activity.SpeechActionActivity",
"extras": {
"ee.ioc.phon.android.extra.VOICE_PROMPT": "Say the trigger phrase hey wake up",
"ee.ioc.phon.android.extra.SERVICE_COMPONENT": "ee.ioc.phon.android.speechtrigger/.TriggerService",
"android.speech.extra.PROMPT": "Say: hey wake up",
"android.speech.extra.MAX_RESULTS": 1,
"android.speech.extra.LANGUAGE": "K6_LANGUAGE",
"ee.ioc.phon.android.extra.AUTO_START": True,
"ee.ioc.phon.android.extra.FINISH_AFTER_LAUNCH_INTENT": False,
"ee.ioc.phon.android.extra.RETURN_ERRORS": True,
"ee.ioc.phon.android.extra.PHRASE": "hey wake up",
"ee.ioc.phon.android.extra.RESULT_REWRITES": ["Trigger"]
}
}
To start a speech trigger open the Kõnele search panel (lets call it Activity1), switch to any service and say "start speech trigger". As a result the Kõnele search panel is restarted (Activity2) but now using a specific service "TriggerService" (TODO: publish). This service listens indefinitely unless it hears "hey wake up", in which case it returns immediately. Actvity2 applies THIS rewrite table (which needs to be saved under the name "Trigger") to the result, starting an activity (Activity3) referenced in trigger-service rows of THIS table. Activity2 does not finish because we want to return to it later. Activity3 expects a command for the Hue lights (because it processes it with the Hue-table). The Hue-table launches Activity4 which just sends an HTTP query to the lights and then finishes. Activity3 has already finished (immediately after Activity4 is launched), so we land again in Activity2, closing the loop, and starting again to listen to the trigger phrase. Activity3 can also result in an error (no match, timeout, etc.), in which case the error is passed to Activity2, which can either ignore it or react to it (TODO: this would need another EXTRA).
3
et:käivita kõne ?lüliti{
"component": "ee.ioc.phon.android.speak/.activity.SpeechActionActivity",
"extras": {
"ee.ioc.phon.android.extra.VOICE_PROMPT": "Öelge lülitifraas",
"ee.ioc.phon.android.extra.SERVICE_COMPONENT": "ee.ioc.phon.android.speechtrigger/.TriggerService",
"android.speech.extra.PROMPT": "Öelge lülitifraas",
"android.speech.extra.MAX_RESULTS": 1,
"android.speech.extra.LANGUAGE": "K6_LANGUAGE",
"ee.ioc.phon.android.extra.AUTO_START": True,
"ee.ioc.phon.android.extra.FINISH_AFTER_LAUNCH_INTENT": False,
"ee.ioc.phon.android.extra.RETURN_ERRORS": True,
"ee.ioc.phon.android.extra.RESULT_REWRITES": ["Trigger"]
}
}
4
trigger:^[^{].+{
"component": "ee.ioc.phon.android.speak/.activity.SpeechActionActivity",
"extras": {
"ee.ioc.phon.android.extra.VOICE_PROMPT": "K6_VOICE_PROMPT",
"ee.ioc.phon.android.extra.SERVICE_COMPONENT": "K6_SERVICE_COMPONENT",
"android.speech.extra.PROMPT": "Lights/Hue",
"android.speech.extra.MAX_RESULTS": 1,
"android.speech.extra.LANGUAGE": "K6_LANGUAGE",
"ee.ioc.phon.android.extra.AUTO_START": True,
"ee.ioc.phon.android.extra.FINISH_AFTER_LAUNCH_INTENT": True,
"ee.ioc.phon.android.extra.RETURN_ERRORS": True,
"ee.ioc.phon.android.extra.RESULT_REWRITES": [K6_RESULT_REWRITES]
}
}
5
K6_RESULT_REWRITES"Lights", "Lights.Hue"Can be any table which launches only intents that finish immediately.
6
en:K6_LANGUAGEen-US
7
entrigger:K6_SERVICE_COMPONENTcom.google.android.googlequicksearchbox/com.google.android.voicesearch.serviceapi.GoogleRecognitionService
8
entrigger:K6_VOICE_PROMPTSay something to the lightsThe prompt must correspond to K6_RESULT_REWRITES
9
et:K6_LANGUAGEet-EE
10
ettrigger:K6_SERVICE_COMPONENTee.ioc.phon.android.speak/.service.WebSocketRecognitionService
11
ettrigger:K6_VOICE_PROMPTÖelge nüüd valgustitele midagiThe prompt must correspond to K6_RESULT_REWRITES
12
:^([{].+)activity$1