Skip to content

Commit

Permalink
bugfix: server io rec
Browse files Browse the repository at this point in the history
  • Loading branch information
w-okada committed Jun 28, 2023
1 parent 7b50b9f commit b5e3f11
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions client/demo/dist/index.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion client/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"build:dev": "npm-run-all clean webpack:dev",
"start": "webpack-dev-server --config webpack.dev.js",
"build:mod": "cd ../lib && npm run build:dev && cd - && cp -r ../lib/dist/* node_modules/@dannadori/voice-changer-client-js/dist/",
"build:mod_dos": "cd ../lib && npm run build:dev && cd ../demo && cp ../lib/dist/index.js node_modules/@dannadori/voice-changer-client-js/dist/",
"build:mod_dos": "cd ../lib && npm run build:dev && cd ../demo && copy ../lib/dist/index.js node_modules/@dannadori/voice-changer-client-js/dist/",
"build:mod_dos2": "copy ../lib/dist/index.js node_modules/@dannadori/voice-changer-client-js/dist/",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const RecorderArea = (_props: RecorderAreaProps) => {
</>
)

}, [serverIORecording, audioOutputForAnalyzer, outputAudioDeviceInfo])
}, [serverIORecording, audioOutputForAnalyzer, outputAudioDeviceInfo, serverSetting.updateServerSettings])

return (
<div className="config-sub-area">
Expand Down
6 changes: 1 addition & 5 deletions client/lib/src/hooks/useServerSetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,10 @@ export const useServerSetting = (props: UseServerSettingProps): ServerSettingSta
const k = Object.values(ServerSettingKey)[i] as keyof VoiceChangerServerSetting
const cur_v = serverSetting[k]
const new_v = setting[k]

if (cur_v != new_v) {
const res = await props.voiceChangerClient.updateServerSettings(k, "" + new_v)

setServerSetting(res)
const storeData = { ...res }
storeData.recordIO = 0
}
}
}
Expand Down Expand Up @@ -186,8 +184,6 @@ export const useServerSetting = (props: UseServerSettingProps): ServerSettingSta
if (!props.voiceChangerClient) return
const res = await props.voiceChangerClient.getServerSettings()
setServerSetting(res)
const storeData = { ...res }
storeData.recordIO = 0
}
}, [props.voiceChangerClient])

Expand Down

0 comments on commit b5e3f11

Please sign in to comment.