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
53
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
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
1
110
Provide/Inject で TypeScript の恩恵を受ける方法
azuki
3
84
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
240
OSS contributor への第一歩を踏み出すまでの物語
azuki
1
170
Eloquent で relation を扱う基礎
azuki
0
97
メイキング・オブ・PHPカンファレンス 〜PHPカンファレンス関西2024の運営スタッフが語る舞台裏〜
azuki
0
61
ブラウザでテキストを読み上げる
azuki
0
110
計画性ないけれどノリと勢いだけで地方でも勉強会を開くすゝめ 〜 PHPカンファレンス関西2024 の懇親会 LT のその後 〜
azuki
0
55
GraphQL 入門
azuki
1
110
Other Decks in Programming
See All in Programming
subpath importsで始めるモック生活
10tera
0
270
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
160
距離関数を極める! / SESSIONS 2024
gam0022
0
260
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
300
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
530
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
as(型アサーション)を書く前にできること
marokanatani
7
2.6k
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
320
役立つログに取り組もう
irof
28
9.5k
受け取る人から提供する人になるということ
little_rubyist
0
230
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Java ジェネリクス入門 2024
nagise
0
720
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Speed Design
sergeychernyshev
24
610
Build your cross-platform service in a week with App Engine
jlugia
229
18k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
GitHub's CSS Performance
jonrohan
1030
460k
Six Lessons from altMBA
skipperchong
27
3.5k
Unsuck your backbone
ammeep
668
57k
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