geckoのweb speech apiまわり
Post on 20-Jul-2015
1.575 Views
Preview:
TRANSCRIPT
2013-09-30 1
GeckoのWeb Speech APIまわり
Gecko勉強会taken
2013-09-30 3
Web Speech API
https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
2013-09-30 4
Web Speech APIとは
● W3CのSpeech API Community Groupで議論– Working Groupへ移行という話も
● API– 音声認識(SpeechRecognition)
var recognition = new SpeechRecognition();recognition.onresult = function(event) { if (event.results.length > 0) {} }recognition.start()
– 音声合成(SpeechSynthesis)speechSynthesis.speak(new SpeechSynthesisUtterance('Hello World'));
2013-09-30 5
Geckoでの音声認識
● APIまわり:about:configで有効化可能– dom/webidl/SpeechRecognition.webidl など– content/media/webspeech/recognition/
● バックエンド:テスト用のFakeサービスのみ● 設定:media.webspeech.recognition.enable
2013-09-30 6
Geckoでの音声合成
● APIまわり:about:configで有効化可能– dom/webidl/SpeechSynthesis.webidl など– content/media/webspeech/synth/
● バックエンド:Firefox OSではPicoTTSを利用– content/media/webspeech/synth/pico/
● 設定:media.webspeech.synth.enabled
2013-09-30 7
Geckoのイディオムabout:configによる有効化・無効化
● about:configの設定によってJavaScriptの可視・不可視が変わるオブジェクト
● WebIDL[PrefControlled]interface SpeechSynthesis { …}
2013-09-30 8
Geckoのイディオムabout:configによる有効化・無効化
● C++– WebIDLからConstructorEnabledが自動生成される
● SpeechSynth::PrefEnabled()を呼ぶ– PrefEnabled: (手書き)
if (!gPrefInitialized) { Preferences::AddBoolVarCache(&gWebSpeechEnabled, "media.webspeech.synth.enabled"); gPrefInitialized = true;}return gWebSpeechEnabled;
2013-09-30 9
まとめ
● GeckoはWeb Speech APIを実装中– 音声認識API– 音声合成API
● Geckoでのイディオム– about:configによる有効化・無効化
top related