-
Notifications
You must be signed in to change notification settings - Fork 17
コンポーネント分割 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
コンポーネント分割 #1
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/yoidea/bragging-detector/nun35qndn |
|
見て貰う人おれへんから自問自答するか |
| const [userMusicName, setUserMusicName] = useState(""); // ファイル名 | ||
|
|
||
| useEffect(() => { | ||
| const music = new Audio("/static/warning01.mp3"); // デフォルト音 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
デプロイ時にAudioインスタンスでエラーが出たから、useEffect内に含めて必ずクライアントのみで実行するようにした。
| setDetecting(false); | ||
| }; | ||
| recognizerRef.current.onresult = event => { | ||
| [...event.results].slice(event.resultIndex).forEach(result => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
event.resultsは俗に言う連想配列みたいな形をしてたから配列に変換して反復処理している。
| setTranscript(""); | ||
| } else { | ||
| // 音声認識の途中経過 | ||
| if (tagValues.some(value => transcript.includes(value))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
認識した文章に検知する単語が含まれていれば
No description provided.