Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Voice Recognition in JavaScript
Search
SAW
March 13, 2024
Programming
0
44
Voice Recognition in JavaScript
A presentation slide of Kyoto.js 21.
SAW
March 13, 2024
Tweet
Share
More Decks by SAW
See All by SAW
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
210
OSS contributor への第一歩を踏み出すまでの物語
azuki
1
140
Eloquent で relation を扱う基礎
azuki
0
64
メイキング・オブ・PHPカンファレンス 〜PHPカンファレンス関西2024の運営スタッフが語る舞台裏〜
azuki
0
54
ブラウザでテキストを読み上げる
azuki
0
91
計画性ないけれどノリと勢いだけで地方でも勉強会を開くすゝめ 〜 PHPカンファレンス関西2024 の懇親会 LT のその後 〜
azuki
0
46
GraphQL 入門
azuki
1
84
JavaScript で音声認識を試してみよう
azuki
0
110
Nuxt で GraphQL のクエリを送信する方法
azuki
2
150
Other Decks in Programming
See All in Programming
What is Parser
yui_knk
9
3.9k
GraphQL あるいは React における自律的なデータ取得について
quramy
9
2.6k
Amazon BedrockでサーバレスなAIお料理ボットを作成する!!
tosuri13
0
110
マルチモジュールにおけるテスト最適化
fxwx23
0
190
Rechartsで楽にゴリゴリにカスタマイズする!
10tera
1
140
Jakarta EE meets AI
ivargrimstad
0
200
Kotlin 2.0 and Beyond
antonarhipov
2
140
Regular Expressions, REXML, Automata Learning
makenowjust
0
190
connect-go で面倒くささと戦う / 2024-08-27 #newmo_layerx_go
izumin5210
2
610
事業フェーズの変化に対応する 開発生産性向上のゼロイチ
masaygggg
0
120
ECMAScript、Web標準の型はどう管理されているか / How ECMAScript and Web standards types are maintained
petamoriken
3
380
Method Swizzlingを行うライブラリにおけるマルチモジュール設計
yoshikma
0
110
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
78
8.6k
Building Better People: How to give real-time feedback that sticks.
wjessup
359
18k
A Philosophy of Restraint
colly
202
16k
Creatively Recalculating Your Daily Design Routine
revolveconf
215
12k
Optimising Largest Contentful Paint
csswizardry
29
2.8k
4 Signs Your Business is Dying
shpigford
179
21k
Happy Clients
brianwarren
96
6.6k
Side Projects
sachag
451
42k
Designing for humans not robots
tammielis
248
25k
Imperfection Machines: The Place of Print at Facebook
scottboms
263
13k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Web development in the modern age
philhawksworth
204
10k
Transcript
7PJDF3FDPHOJUJPOJO+BWB4DSJQU ,ZPUPKT 4"8
$(whoami) /BNF4PJDIJSP,BUP "HF /JDLOBNF4"8 NBLFT*5FOHJOFFSDPNNVOJUZIFBUJO,BOTBJBSFB -JWFJO0TBLB(SFXVQJO"JDIJ 9 BLB5XJUUFS !B[VLJ@FBUFS
.ZTUSPOHBSFB8FCBQQMJDBUJPOEFWFMPQNFOU 7VF -BSBWFM 2
7PJDF3FDPHOJUJPOJO+BWB4DSJQU 6TF4QFFDI3FDPHOJUJPO"1* CSPXTFSTBTLVTUPBMMPXUPVTFNJDSPQIPOFBU fi STUVTF 0OMZBWBJMBCMFPO)5514 FYDFQUJPOUIF"1*JTBWBJMBCMFPO)551POlocalhost 3
5IF#BTJD'MPXPG7PJDF3FDPHOJUJPO6TBHF (FOFSBUFBOJOTUBODFPGSpeechRecognition 4UBSUWPJDFSFDPHOJUJPOCZstart()NFUIPE (FUWPJDFJOQVUSFTVMUCZonresult()NFUIPE 4
(FOFSBUJOHBSpeechRecognitionJOTUBODF (FUSpeechRecognitionQSPQFSUZGSPNwindowPCKFDU (FUUIFQSPQFSUZwebkitSpeechRecognitionPO4BGBSJBOE(PPHMF $ISPNF 5 // Get SpeechRecognition property. const
speechRecognition = // Get SpeechRecognition or webkitSpeechRecogntion window.SpeechRecognition || window.webkitSpeechRecognition; const recognition = new speechRecognition();
4UBSU7PJDF3FDPHOJUJPO"OE(FUUIF3FTVMU 4UBSUWPJDFSFDPHOJUJPOCZstart()JOSpeechRecognition 5IFQFSNJTTJPOSFRVJSFEUPVTFNJDSPQIPOFBU fi STUFYFDVUJPO (FUSFTVMUCZonresult()JOSpeechRecognition 4FUBIBOEMFSUPonresult()BSHVNFOU (FUSFTVMUGSPNUIFTUBSHVNFOUJOUIFIBOEMFS 5IFSFTVMUJODMVEFEJOresults[0][0].transcriptJO SpeechRecognitionEvent
6
&YBNQMFPGstart()onresult()*NQMFNFOUBUJPO 7 // begin voice recognition recognition.start(); // get voice
recognition result recognition.onresult((event) => { const { transcript } = event.results[0][0]; console.log(transcript); });
4QFDJGZUIF-BOHVBHFUP3FDPHOJ[F 4QFDJ fi FEUIFMBOHVBHFPOlangQSPQFSUZJOSpeechRecognition 5IFWBMVFPGlangQSPQFSUZJO)5.-PSCSPXTFSMBOHVBHFGPSEFGBVMU 8 recognition.lang = 'ja-JP';
"DUVBM&YBNQMF 8FC"QQUPMFBSO&OHMJTIXPSET XPSLJOQSPHSFTT -PPLBUJNBHFBOETBZUIFXPSEPGUIFJNBHF -FBSOWPDBCVMBSZXJUIJNBHF 6TF4QFFDI3FDPHOJUJPO"1*JOBQQMJDBUJPO BWBJMBCMFUPFYUFOEGPSPUIFSMBOHVBHFT 9
-JNJUBUJPOPG4QFFDI3FDPHOJUJPO"1* 4PNFCSPXTFSTOPUTVQQPSU4QFFDI3FDPHOJUJPO"1* 'JSFGPY &EHF FUD 5ZQFEF fi OJUJPOOPUTVQQPSUFEJO5ZQF4DSJQU /FFEUPEF fi
OFCZPVSTFMWFT PSDBTUwindow as any 1 0
$PODMVTJPO *OUSPEVDFEWPJDFSFDPHOJUJPOJO+BWB4DSJQU 6TF4QFFDI3FDPHOJUJPO"1* 5IFCBTJD fl PXPG4QFFDI3FDPHOJUJPO"1*VTBHF 4UBSUSFDPHOJUJPOCZstart()NFUIPE (FUSFTVMUCZonresult() -JNJUBUJPOPG4QFFDI3FDPHOJUJPO"1* 4PNFCSPXTFSTOPUTVQQPSUFE
5ZQFEF fi OJUJPOOPUTVQQPSUFEJO5ZQF4DSJQU 1 1
5IBOLZPVGPSMJTUFOJOH