bugfix:protocol
This commit is contained in:
parent
50a818f7ec
commit
e6c2f4f2b4
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
@ -126,29 +126,6 @@ export const useServerSettingArea = (props: UseServerSettingProps): ServerSettin
|
|||||||
props.clientState.serverSetting.isUploading,
|
props.clientState.serverSetting.isUploading,
|
||||||
props.clientState.serverSetting.uploadProgress])
|
props.clientState.serverSetting.uploadProgress])
|
||||||
|
|
||||||
const protocolRow = useMemo(() => {
|
|
||||||
const onProtocolChanged = async (val: Protocol) => {
|
|
||||||
props.clientState.clientSetting.setProtocol(val)
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<div className="body-row split-3-7 left-padding-1 guided">
|
|
||||||
<div className="body-item-title left-padding-1">Protocol</div>
|
|
||||||
<div className="body-select-container">
|
|
||||||
<select className="body-select" value={props.clientState.clientSetting.setting.protocol} onChange={(e) => {
|
|
||||||
onProtocolChanged(e.target.value as
|
|
||||||
Protocol)
|
|
||||||
}}>
|
|
||||||
{
|
|
||||||
Object.values(Protocol).map(x => {
|
|
||||||
return <option key={x} value={x}>{x}</option>
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}, [props.clientState.clientSetting.setting.protocol, props.clientState.clientSetting.setProtocol])
|
|
||||||
|
|
||||||
const frameworkRow = useMemo(() => {
|
const frameworkRow = useMemo(() => {
|
||||||
const onFrameworkChanged = async (val: Framework) => {
|
const onFrameworkChanged = async (val: Framework) => {
|
||||||
props.clientState.serverSetting.setFramework(val)
|
props.clientState.serverSetting.setFramework(val)
|
||||||
@ -209,10 +186,9 @@ export const useServerSettingArea = (props: UseServerSettingProps): ServerSettin
|
|||||||
{uploadeModelRow}
|
{uploadeModelRow}
|
||||||
{frameworkRow}
|
{frameworkRow}
|
||||||
{onnxExecutionProviderRow}
|
{onnxExecutionProviderRow}
|
||||||
{protocolRow}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}, [uploadeModelRow, frameworkRow, onnxExecutionProviderRow, protocolRow])
|
}, [uploadeModelRow, frameworkRow, onnxExecutionProviderRow])
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { BufferSize, SampleRate, VoiceChangerMode } from "@dannadori/voice-changer-client-js"
|
import { BufferSize, Protocol, SampleRate, VoiceChangerMode } from "@dannadori/voice-changer-client-js"
|
||||||
import React, { useMemo, useState } from "react"
|
import React, { useMemo, useState } from "react"
|
||||||
import { ClientState } from "./hooks/useClient"
|
import { ClientState } from "./hooks/useClient"
|
||||||
|
|
||||||
@ -31,6 +31,30 @@ export const useAdvancedSetting = (props: UseAdvancedSettingProps): AdvancedSett
|
|||||||
)
|
)
|
||||||
}, [props.clientState.clientSetting.setting.mmvcServerUrl, props.clientState.clientSetting.setServerUrl])
|
}, [props.clientState.clientSetting.setting.mmvcServerUrl, props.clientState.clientSetting.setServerUrl])
|
||||||
|
|
||||||
|
const protocolRow = useMemo(() => {
|
||||||
|
const onProtocolChanged = async (val: Protocol) => {
|
||||||
|
props.clientState.clientSetting.setProtocol(val)
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div className="body-row split-3-7 left-padding-1 guided">
|
||||||
|
<div className="body-item-title left-padding-1">Protocol</div>
|
||||||
|
<div className="body-select-container">
|
||||||
|
<select className="body-select" value={props.clientState.clientSetting.setting.protocol} onChange={(e) => {
|
||||||
|
onProtocolChanged(e.target.value as
|
||||||
|
Protocol)
|
||||||
|
}}>
|
||||||
|
{
|
||||||
|
Object.values(Protocol).map(x => {
|
||||||
|
return <option key={x} value={x}>{x}</option>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}, [props.clientState.clientSetting.setting.protocol, props.clientState.clientSetting.setProtocol])
|
||||||
|
|
||||||
|
|
||||||
const sampleRateRow = useMemo(() => {
|
const sampleRateRow = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
<div className="body-row split-3-7 left-padding-1 guided">
|
<div className="body-row split-3-7 left-padding-1 guided">
|
||||||
@ -209,6 +233,7 @@ export const useAdvancedSetting = (props: UseAdvancedSettingProps): AdvancedSett
|
|||||||
<>
|
<>
|
||||||
<div className="body-row divider"></div>
|
<div className="body-row divider"></div>
|
||||||
{mmvcServerUrlRow}
|
{mmvcServerUrlRow}
|
||||||
|
{protocolRow}
|
||||||
<div className="body-row divider"></div>
|
<div className="body-row divider"></div>
|
||||||
{sampleRateRow}
|
{sampleRateRow}
|
||||||
{bufferSizeRow}
|
{bufferSizeRow}
|
||||||
@ -226,7 +251,7 @@ export const useAdvancedSetting = (props: UseAdvancedSettingProps): AdvancedSett
|
|||||||
<div className="body-row divider"></div>
|
<div className="body-row divider"></div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}, [showAdvancedSetting, mmvcServerUrlRow, sampleRateRow, bufferSizeRow, convertChunkNumRow, crossFadeOverlapRateRow, crossFadeOffsetRateRow, crossFadeEndRateRow, vfForceDisableRow, voiceChangeModeRow, workletSettingRow])
|
}, [showAdvancedSetting, mmvcServerUrlRow, protocolRow, sampleRateRow, bufferSizeRow, convertChunkNumRow, crossFadeOverlapRateRow, crossFadeOffsetRateRow, crossFadeEndRateRow, vfForceDisableRow, voiceChangeModeRow, workletSettingRow])
|
||||||
|
|
||||||
|
|
||||||
const advancedSetting = useMemo(() => {
|
const advancedSetting = useMemo(() => {
|
||||||
|
@ -158,9 +158,8 @@ export const useClientSetting = (props: UseClientSettingProps): ClientSettingSta
|
|||||||
const params = new URLSearchParams(location.search);
|
const params = new URLSearchParams(location.search);
|
||||||
const colab = params.get("colab")
|
const colab = params.get("colab")
|
||||||
if (colab == "true") {
|
if (colab == "true") {
|
||||||
settingRef.current.protocol = "rest"
|
setProtocol("rest")
|
||||||
settingRef.current.inputChunkNum = 64
|
setInputChunkNum(64)
|
||||||
_setSetting({ ...settingRef.current })
|
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user