set default
This commit is contained in:
parent
e7822e2cff
commit
8ec0e9c8c8
2
client/demo/dist/index.js
vendored
2
client/demo/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -150,9 +150,8 @@ export const useClientSetting = (props: UseClientSettingProps): ClientSettingSta
|
||||
}
|
||||
}, [props.voiceChangerClient])
|
||||
|
||||
|
||||
//////////////
|
||||
// Colab対応
|
||||
// デフォルト設定
|
||||
/////////////
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(location.search);
|
||||
@ -160,10 +159,16 @@ export const useClientSetting = (props: UseClientSettingProps): ClientSettingSta
|
||||
if (colab == "true") {
|
||||
setProtocol("rest")
|
||||
setInputChunkNum(64)
|
||||
|
||||
} else {
|
||||
setProtocol("sio")
|
||||
setInputChunkNum(32)
|
||||
|
||||
}
|
||||
}, [props.voiceChangerClient])
|
||||
|
||||
|
||||
|
||||
return {
|
||||
setting,
|
||||
setServerUrl,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { DefaultVoiceChangerServerSetting, Framework, OnnxExecutionProvider, ServerInfo, ServerSettingKey, VoiceChangerClient, VoiceChangerServerSetting, } from "@dannadori/voice-changer-client-js"
|
||||
import { useState, useMemo, useRef, } from "react"
|
||||
import { useState, useMemo, useRef, useEffect } from "react"
|
||||
|
||||
|
||||
export type FileUploadSetting = {
|
||||
@ -195,6 +195,20 @@ export const useServerSetting = (props: UseServerSettingProps): ServerSettingSta
|
||||
}
|
||||
}, [props.voiceChangerClient])
|
||||
|
||||
|
||||
//////////////
|
||||
// デフォルト設定
|
||||
/////////////
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(location.search);
|
||||
const colab = params.get("colab")
|
||||
if (colab == "true") {
|
||||
} else {
|
||||
}
|
||||
}, [props.voiceChangerClient])
|
||||
|
||||
|
||||
|
||||
return {
|
||||
setting,
|
||||
serverInfo,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { DefaultWorkletSetting, VoiceChangerClient, WorkletSetting } from "@dannadori/voice-changer-client-js"
|
||||
import { useState, useMemo } from "react"
|
||||
import { useState, useMemo, useEffect } from "react"
|
||||
|
||||
export type UseWorkletSettingProps = {
|
||||
voiceChangerClient: VoiceChangerClient | null
|
||||
@ -22,6 +22,28 @@ export const useWorkletSetting = (props: UseWorkletSettingProps): WorkletSetting
|
||||
}
|
||||
}, [props.voiceChangerClient])
|
||||
|
||||
|
||||
//////////////
|
||||
// デフォルト設定
|
||||
/////////////
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(location.search);
|
||||
const colab = params.get("colab")
|
||||
if (colab == "true") {
|
||||
setSetting({
|
||||
numTrancateTreshold: 300,
|
||||
volTrancateThreshold: 0.0005,
|
||||
volTrancateLength: 32,
|
||||
})
|
||||
} else {
|
||||
setSetting({
|
||||
numTrancateTreshold: 150,
|
||||
volTrancateThreshold: 0.0005,
|
||||
volTrancateLength: 32,
|
||||
})
|
||||
}
|
||||
}, [props.voiceChangerClient])
|
||||
|
||||
return {
|
||||
setting,
|
||||
setSetting
|
||||
|
Loading…
x
Reference in New Issue
Block a user