Confirmed users
85
edits
(add more files) |
(Add api limitation details) |
||
| Line 1: | Line 1: | ||
= Architecture = | = Architecture = | ||
== API limitation == | |||
Acess to the speech recognition is limited to certified apps (at the time of writing), using the 'Func' parameter inside the WebIDL constructor: | |||
<pre> | |||
Func="SpeechRecognition::IsAuthorized" | |||
</pre> | |||
'''IsAuthorized''' is implemented inside the SpeechRecognition class: | |||
<pre> | |||
bool | |||
SpeechRecognition::IsAuthorized(JSContext* aCx, JSObject* aGlobal) | |||
{ | |||
bool inCertifiedApp = IsInCertifiedApp(aCx, aGlobal); | |||
bool enableTests = Preferences::GetBool(TEST_PREFERENCE_ENABLE); | |||
bool enableRecognitionEnable = Preferences::GetBool(TEST_PREFERENCE_RECOGNITION_ENABLE); | |||
bool enableRecognitionForceEnable = Preferences::GetBool(TEST_PREFERENCE_RECOGNITION_FORCE_ENABLE); | |||
return (inCertifiedApp || enableRecognitionForceEnable || enableTests) && enableRecognitionEnable; | |||
} | |||
</pre> | |||
== Relevant files in the Gecko source tree == | == Relevant files in the Gecko source tree == | ||
pocketsphinx library code: | pocketsphinx library code: | ||