mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
WIP: gui commonize 3
This commit is contained in:
parent
604846b0c6
commit
568e06ed2f
@ -4,7 +4,7 @@
|
||||
"front": {
|
||||
"title": {
|
||||
"mainTitle": "VC Client",
|
||||
"subTitle": "MMVC for v.1.3",
|
||||
"subTitle": "for MMVC v.1.3",
|
||||
"lineNum": 1
|
||||
},
|
||||
"serverControl": {},
|
||||
@ -12,7 +12,8 @@
|
||||
"ONNXEnable": true,
|
||||
"pyTorchEnable": true,
|
||||
"MMVCCorrespondense": false,
|
||||
"pyTorchClusterEnable": false
|
||||
"pyTorchClusterEnable": false,
|
||||
"showPyTorchDefault": false
|
||||
},
|
||||
"deviceSetting": {},
|
||||
"qualityControl": {
|
||||
|
59
client/demo_v13/dist/assets/gui_settings/MMVCv15.json
vendored
Normal file
59
client/demo_v13/dist/assets/gui_settings/MMVCv15.json
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"type": "demo",
|
||||
"id": "MMVCv15",
|
||||
"front": {
|
||||
"title": {
|
||||
"mainTitle": "VC Client",
|
||||
"subTitle": "for MMVC v.1.5",
|
||||
"lineNum": 1
|
||||
},
|
||||
"serverControl": {},
|
||||
"modelSetting": {
|
||||
"ONNXEnable": true,
|
||||
"pyTorchEnable": true,
|
||||
"MMVCCorrespondense": true,
|
||||
"pyTorchClusterEnable": false,
|
||||
"showPyTorchDefault": false
|
||||
},
|
||||
"deviceSetting": {},
|
||||
"qualityControl": {
|
||||
"F0DetectorEnable": true
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": true,
|
||||
"srcIdEnable": true,
|
||||
"editSpeakerIdMappingEnable": false,
|
||||
"f0FactorEnable": true,
|
||||
"tuningEnable": false,
|
||||
"clusterInferRationEnable": false,
|
||||
"noiseScaleEnable": false,
|
||||
"silentThresholdEnable": false
|
||||
},
|
||||
"converterSetting": {
|
||||
"extraDataLengthEnable": false
|
||||
},
|
||||
"advancedSetting": {
|
||||
"serverURLEnable": true,
|
||||
"protocolEnable": true,
|
||||
"sampleRateEnable": true,
|
||||
"sendingSampleRateEnable": true,
|
||||
"crossFadeOverlapSizeEnable": true,
|
||||
"crossFadeOffsetRateEnable": true,
|
||||
"crossFadeEndRateEnable": true,
|
||||
"downSamplingModeEnable": true,
|
||||
"trancateNumTresholdEnable": true
|
||||
}
|
||||
},
|
||||
|
||||
"dialogs": {
|
||||
"license": [
|
||||
{
|
||||
"title": "c",
|
||||
"auther": "c",
|
||||
"contact": "b",
|
||||
"url": "a",
|
||||
"license": "MIT"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
59
client/demo_v13/dist/assets/gui_settings/so-vits-svc-40.json
vendored
Normal file
59
client/demo_v13/dist/assets/gui_settings/so-vits-svc-40.json
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"type": "demo",
|
||||
"id": "so-vits-svc-40",
|
||||
"front": {
|
||||
"title": {
|
||||
"mainTitle": "VC Client",
|
||||
"subTitle": "for so-vits-svc-40",
|
||||
"lineNum": 1
|
||||
},
|
||||
"serverControl": {},
|
||||
"modelSetting": {
|
||||
"ONNXEnable": false,
|
||||
"pyTorchEnable": true,
|
||||
"MMVCCorrespondense": false,
|
||||
"pyTorchClusterEnable": true,
|
||||
"showPyTorchDefault": true
|
||||
},
|
||||
"deviceSetting": {},
|
||||
"qualityControl": {
|
||||
"F0DetectorEnable": true
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": false,
|
||||
"srcIdEnable": false,
|
||||
"editSpeakerIdMappingEnable": false,
|
||||
"f0FactorEnable": false,
|
||||
"tuningEnable": true,
|
||||
"clusterInferRationEnable": true,
|
||||
"noiseScaleEnable": true,
|
||||
"silentThresholdEnable": true
|
||||
},
|
||||
"converterSetting": {
|
||||
"extraDataLengthEnable": true
|
||||
},
|
||||
"advancedSetting": {
|
||||
"serverURLEnable": true,
|
||||
"protocolEnable": true,
|
||||
"sampleRateEnable": true,
|
||||
"sendingSampleRateEnable": true,
|
||||
"crossFadeOverlapSizeEnable": true,
|
||||
"crossFadeOffsetRateEnable": true,
|
||||
"crossFadeEndRateEnable": true,
|
||||
"downSamplingModeEnable": true,
|
||||
"trancateNumTresholdEnable": true
|
||||
}
|
||||
},
|
||||
|
||||
"dialogs": {
|
||||
"license": [
|
||||
{
|
||||
"title": "c",
|
||||
"auther": "c",
|
||||
"contact": "b",
|
||||
"url": "a",
|
||||
"license": "MIT"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
59
client/demo_v13/dist/assets/gui_settings/so-vits-svc-40v2.json
vendored
Normal file
59
client/demo_v13/dist/assets/gui_settings/so-vits-svc-40v2.json
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"type": "demo",
|
||||
"id": "so-vits-svc-40v2",
|
||||
"front": {
|
||||
"title": {
|
||||
"mainTitle": "VC Client",
|
||||
"subTitle": "for so-vits-svc-40v2",
|
||||
"lineNum": 1
|
||||
},
|
||||
"serverControl": {},
|
||||
"modelSetting": {
|
||||
"ONNXEnable": false,
|
||||
"pyTorchEnable": true,
|
||||
"MMVCCorrespondense": false,
|
||||
"pyTorchClusterEnable": true,
|
||||
"showPyTorchDefault": true
|
||||
},
|
||||
"deviceSetting": {},
|
||||
"qualityControl": {
|
||||
"F0DetectorEnable": true
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": false,
|
||||
"srcIdEnable": false,
|
||||
"editSpeakerIdMappingEnable": false,
|
||||
"f0FactorEnable": false,
|
||||
"tuningEnable": true,
|
||||
"clusterInferRationEnable": true,
|
||||
"noiseScaleEnable": true,
|
||||
"silentThresholdEnable": true
|
||||
},
|
||||
"converterSetting": {
|
||||
"extraDataLengthEnable": true
|
||||
},
|
||||
"advancedSetting": {
|
||||
"serverURLEnable": true,
|
||||
"protocolEnable": true,
|
||||
"sampleRateEnable": true,
|
||||
"sendingSampleRateEnable": true,
|
||||
"crossFadeOverlapSizeEnable": true,
|
||||
"crossFadeOffsetRateEnable": true,
|
||||
"crossFadeEndRateEnable": true,
|
||||
"downSamplingModeEnable": true,
|
||||
"trancateNumTresholdEnable": true
|
||||
}
|
||||
},
|
||||
|
||||
"dialogs": {
|
||||
"license": [
|
||||
{
|
||||
"title": "c",
|
||||
"auther": "c",
|
||||
"contact": "b",
|
||||
"url": "a",
|
||||
"license": "MIT"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
66
client/demo_v13/dist/index.js
vendored
66
client/demo_v13/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
"front": {
|
||||
"title": {
|
||||
"mainTitle": "VC Client",
|
||||
"subTitle": "MMVC for v.1.3",
|
||||
"subTitle": "for MMVC v.1.3",
|
||||
"lineNum": 1
|
||||
},
|
||||
"serverControl": {},
|
||||
@ -12,7 +12,8 @@
|
||||
"ONNXEnable": true,
|
||||
"pyTorchEnable": true,
|
||||
"MMVCCorrespondense": false,
|
||||
"pyTorchClusterEnable": false
|
||||
"pyTorchClusterEnable": false,
|
||||
"showPyTorchDefault": false
|
||||
},
|
||||
"deviceSetting": {},
|
||||
"qualityControl": {
|
||||
|
59
client/demo_v13/public/assets/gui_settings/MMVCv15.json
Normal file
59
client/demo_v13/public/assets/gui_settings/MMVCv15.json
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"type": "demo",
|
||||
"id": "MMVCv15",
|
||||
"front": {
|
||||
"title": {
|
||||
"mainTitle": "VC Client",
|
||||
"subTitle": "for MMVC v.1.5",
|
||||
"lineNum": 1
|
||||
},
|
||||
"serverControl": {},
|
||||
"modelSetting": {
|
||||
"ONNXEnable": true,
|
||||
"pyTorchEnable": true,
|
||||
"MMVCCorrespondense": true,
|
||||
"pyTorchClusterEnable": false,
|
||||
"showPyTorchDefault": false
|
||||
},
|
||||
"deviceSetting": {},
|
||||
"qualityControl": {
|
||||
"F0DetectorEnable": true
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": true,
|
||||
"srcIdEnable": true,
|
||||
"editSpeakerIdMappingEnable": false,
|
||||
"f0FactorEnable": true,
|
||||
"tuningEnable": false,
|
||||
"clusterInferRationEnable": false,
|
||||
"noiseScaleEnable": false,
|
||||
"silentThresholdEnable": false
|
||||
},
|
||||
"converterSetting": {
|
||||
"extraDataLengthEnable": false
|
||||
},
|
||||
"advancedSetting": {
|
||||
"serverURLEnable": true,
|
||||
"protocolEnable": true,
|
||||
"sampleRateEnable": true,
|
||||
"sendingSampleRateEnable": true,
|
||||
"crossFadeOverlapSizeEnable": true,
|
||||
"crossFadeOffsetRateEnable": true,
|
||||
"crossFadeEndRateEnable": true,
|
||||
"downSamplingModeEnable": true,
|
||||
"trancateNumTresholdEnable": true
|
||||
}
|
||||
},
|
||||
|
||||
"dialogs": {
|
||||
"license": [
|
||||
{
|
||||
"title": "c",
|
||||
"auther": "c",
|
||||
"contact": "b",
|
||||
"url": "a",
|
||||
"license": "MIT"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"type": "demo",
|
||||
"id": "so-vits-svc-40",
|
||||
"front": {
|
||||
"title": {
|
||||
"mainTitle": "VC Client",
|
||||
"subTitle": "for so-vits-svc-40",
|
||||
"lineNum": 1
|
||||
},
|
||||
"serverControl": {},
|
||||
"modelSetting": {
|
||||
"ONNXEnable": false,
|
||||
"pyTorchEnable": true,
|
||||
"MMVCCorrespondense": false,
|
||||
"pyTorchClusterEnable": true,
|
||||
"showPyTorchDefault": true
|
||||
},
|
||||
"deviceSetting": {},
|
||||
"qualityControl": {
|
||||
"F0DetectorEnable": true
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": false,
|
||||
"srcIdEnable": false,
|
||||
"editSpeakerIdMappingEnable": false,
|
||||
"f0FactorEnable": false,
|
||||
"tuningEnable": true,
|
||||
"clusterInferRationEnable": true,
|
||||
"noiseScaleEnable": true,
|
||||
"silentThresholdEnable": true
|
||||
},
|
||||
"converterSetting": {
|
||||
"extraDataLengthEnable": true
|
||||
},
|
||||
"advancedSetting": {
|
||||
"serverURLEnable": true,
|
||||
"protocolEnable": true,
|
||||
"sampleRateEnable": true,
|
||||
"sendingSampleRateEnable": true,
|
||||
"crossFadeOverlapSizeEnable": true,
|
||||
"crossFadeOffsetRateEnable": true,
|
||||
"crossFadeEndRateEnable": true,
|
||||
"downSamplingModeEnable": true,
|
||||
"trancateNumTresholdEnable": true
|
||||
}
|
||||
},
|
||||
|
||||
"dialogs": {
|
||||
"license": [
|
||||
{
|
||||
"title": "c",
|
||||
"auther": "c",
|
||||
"contact": "b",
|
||||
"url": "a",
|
||||
"license": "MIT"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
{
|
||||
"type": "demo",
|
||||
"id": "so-vits-svc-40v2",
|
||||
"front": {
|
||||
"title": {
|
||||
"mainTitle": "VC Client",
|
||||
"subTitle": "for so-vits-svc-40v2",
|
||||
"lineNum": 1
|
||||
},
|
||||
"serverControl": {},
|
||||
"modelSetting": {
|
||||
"ONNXEnable": false,
|
||||
"pyTorchEnable": true,
|
||||
"MMVCCorrespondense": false,
|
||||
"pyTorchClusterEnable": true,
|
||||
"showPyTorchDefault": true
|
||||
},
|
||||
"deviceSetting": {},
|
||||
"qualityControl": {
|
||||
"F0DetectorEnable": true
|
||||
},
|
||||
"speakerSetting": {
|
||||
"showSpeakerF0": false,
|
||||
"srcIdEnable": false,
|
||||
"editSpeakerIdMappingEnable": false,
|
||||
"f0FactorEnable": false,
|
||||
"tuningEnable": true,
|
||||
"clusterInferRationEnable": true,
|
||||
"noiseScaleEnable": true,
|
||||
"silentThresholdEnable": true
|
||||
},
|
||||
"converterSetting": {
|
||||
"extraDataLengthEnable": true
|
||||
},
|
||||
"advancedSetting": {
|
||||
"serverURLEnable": true,
|
||||
"protocolEnable": true,
|
||||
"sampleRateEnable": true,
|
||||
"sendingSampleRateEnable": true,
|
||||
"crossFadeOverlapSizeEnable": true,
|
||||
"crossFadeOffsetRateEnable": true,
|
||||
"crossFadeEndRateEnable": true,
|
||||
"downSamplingModeEnable": true,
|
||||
"trancateNumTresholdEnable": true
|
||||
}
|
||||
},
|
||||
|
||||
"dialogs": {
|
||||
"license": [
|
||||
{
|
||||
"title": "c",
|
||||
"auther": "c",
|
||||
"contact": "b",
|
||||
"url": "a",
|
||||
"license": "MIT"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -2,13 +2,13 @@ import * as React from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import "./css/App.css"
|
||||
import { ErrorInfo, useMemo, useState, } from "react";
|
||||
import { AppStateProvider, useAppState } from "./001_provider/001_AppStateProvider";
|
||||
import { AppStateProvider } from "./001_provider/001_AppStateProvider";
|
||||
|
||||
import { library } from "@fortawesome/fontawesome-svg-core";
|
||||
import { fas } from "@fortawesome/free-solid-svg-icons";
|
||||
import { far } from "@fortawesome/free-regular-svg-icons";
|
||||
import { fab } from "@fortawesome/free-brands-svg-icons";
|
||||
import { AppRootProvider } from "./001_provider/001_AppRootProvider";
|
||||
import { AppRootProvider, useAppRoot } from "./001_provider/001_AppRootProvider";
|
||||
import ErrorBoundary from "./001_provider/900_ErrorBoundary";
|
||||
import { INDEXEDDB_KEY_CLIENT, INDEXEDDB_KEY_MODEL_DATA, INDEXEDDB_KEY_SERVER, INDEXEDDB_KEY_WORKLET, INDEXEDDB_KEY_WORKLETNODE, useIndexedDB } from "@dannadori/voice-changer-client-js";
|
||||
import { CLIENT_TYPE, INDEXEDDB_KEY_AUDIO_OUTPUT } from "./const";
|
||||
@ -21,14 +21,14 @@ const container = document.getElementById("app")!;
|
||||
const root = createRoot(container);
|
||||
|
||||
const App = () => {
|
||||
const appState = useAppState()
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const front = useMemo(() => {
|
||||
if (appState.appGuiSettingState.appGuiSetting.type == "demo") {
|
||||
if (appGuiSettingState.appGuiSetting.type == "demo") {
|
||||
return <Demo></Demo>
|
||||
} else {
|
||||
return <>unknown gui type. {appState.appGuiSettingState.appGuiSetting.type}</>
|
||||
return <>unknown gui type. {appGuiSettingState.appGuiSetting.type}</>
|
||||
}
|
||||
}, [appState.appGuiSettingState.appGuiSetting.type])
|
||||
}, [appGuiSettingState.appGuiSetting.type])
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -38,6 +38,7 @@ const App = () => {
|
||||
}
|
||||
|
||||
const AppStateWrapper = () => {
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
// エラーバウンダリー設定
|
||||
const [error, setError] = useState<{ error: Error, errorInfo: ErrorInfo }>()
|
||||
const { removeItem } = useIndexedDB({ clientType: CLIENT_TYPE })
|
||||
@ -95,13 +96,18 @@ const AppStateWrapper = () => {
|
||||
setError({ error, errorInfo })
|
||||
}
|
||||
|
||||
return (
|
||||
<ErrorBoundary fallback={errorComponent} onError={updateError}>
|
||||
<AppStateProvider>
|
||||
<App></App>
|
||||
</AppStateProvider>
|
||||
</ErrorBoundary>
|
||||
)
|
||||
if (!appGuiSettingState.guiSettingLoaded) {
|
||||
return <></>
|
||||
} else {
|
||||
return (
|
||||
<ErrorBoundary fallback={errorComponent} onError={updateError}>
|
||||
<AppStateProvider>
|
||||
<App></App>
|
||||
</AppStateProvider>
|
||||
</ErrorBoundary>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
root.render(
|
||||
|
@ -19,6 +19,7 @@ export type AppGuiDemoSetting = {
|
||||
"pyTorchEnable": boolean,
|
||||
"MMVCCorrespondense": boolean,
|
||||
"pyTorchClusterEnable": boolean,
|
||||
"showPyTorchDefault": boolean
|
||||
},
|
||||
"deviceSetting": {},
|
||||
"qualityControl": {
|
||||
@ -73,6 +74,7 @@ const InitialAppGuiDemoSetting: AppGuiDemoSetting = {
|
||||
"pyTorchEnable": false,
|
||||
"MMVCCorrespondense": false,
|
||||
"pyTorchClusterEnable": false,
|
||||
"showPyTorchDefault": false
|
||||
},
|
||||
"deviceSetting": {},
|
||||
"qualityControl": {
|
||||
@ -112,6 +114,7 @@ const InitialAppGuiDemoSetting: AppGuiDemoSetting = {
|
||||
|
||||
export type AppGuiSettingState = {
|
||||
appGuiSetting: AppGuiSetting
|
||||
guiSettingLoaded: boolean
|
||||
}
|
||||
|
||||
export type AppGuiSettingStateAndMethod = AppGuiSettingState & {
|
||||
@ -119,6 +122,7 @@ export type AppGuiSettingStateAndMethod = AppGuiSettingState & {
|
||||
}
|
||||
|
||||
export const userAppGuiSetting = (): AppGuiSettingStateAndMethod => {
|
||||
const [guiSettingLoaded, setGuiSettingLoaded] = useState<boolean>(false)
|
||||
const [appGuiSetting, setAppGuiSetting] = useState<AppGuiSetting>(InitialAppGuiDemoSetting)
|
||||
const getAppSetting = async (url: string) => {
|
||||
const res = await fetch(`${url}`, {
|
||||
@ -126,9 +130,11 @@ export const userAppGuiSetting = (): AppGuiSettingStateAndMethod => {
|
||||
})
|
||||
const appSetting = await res.json() as AppGuiSetting
|
||||
setAppGuiSetting(appSetting)
|
||||
setGuiSettingLoaded(true)
|
||||
}
|
||||
return {
|
||||
appGuiSetting,
|
||||
guiSettingLoaded,
|
||||
getAppSetting,
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { ClientState, useClient } from "@dannadori/voice-changer-client-js"
|
||||
import { AUDIO_ELEMENT_FOR_PLAY_RESULT, CLIENT_TYPE } from "../const"
|
||||
import { ClientState, useClient, ClientType } from "@dannadori/voice-changer-client-js"
|
||||
import { AUDIO_ELEMENT_FOR_PLAY_RESULT } from "../const"
|
||||
|
||||
export type UseVCClientProps = {
|
||||
audioContext: AudioContext | null
|
||||
clientType: ClientType
|
||||
}
|
||||
|
||||
export type VCClientState = {
|
||||
@ -10,9 +11,8 @@ export type VCClientState = {
|
||||
}
|
||||
|
||||
export const useVCClient = (props: UseVCClientProps) => {
|
||||
|
||||
const clientState = useClient({
|
||||
clientType: CLIENT_TYPE,
|
||||
clientType: props.clientType,
|
||||
audioContext: props.audioContext,
|
||||
audioOutputElementId: AUDIO_ELEMENT_FOR_PLAY_RESULT
|
||||
})
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React, { useContext } from "react";
|
||||
import React, { useContext, useEffect } from "react";
|
||||
import { ReactNode } from "react";
|
||||
import { AppGuiSettingStateAndMethod, userAppGuiSetting } from "../001_globalHooks/001_useAppGuiSetting";
|
||||
import { AudioConfigState, useAudioConfig } from "../001_globalHooks/001_useAudioConfig";
|
||||
|
||||
type Props = {
|
||||
@ -8,7 +9,7 @@ type Props = {
|
||||
|
||||
type AppRootValue = {
|
||||
audioContextState: AudioConfigState
|
||||
|
||||
appGuiSettingState: AppGuiSettingStateAndMethod
|
||||
}
|
||||
|
||||
const AppRootContext = React.createContext<AppRootValue | null>(null);
|
||||
@ -22,9 +23,17 @@ export const useAppRoot = (): AppRootValue => {
|
||||
|
||||
export const AppRootProvider = ({ children }: Props) => {
|
||||
const audioContextState = useAudioConfig()
|
||||
const appGuiSettingState = userAppGuiSetting()
|
||||
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const modelType = params.get("modelType") || ""
|
||||
appGuiSettingState.getAppSetting(`/assets/gui_settings/${modelType}.json`)
|
||||
}, [])
|
||||
|
||||
const providerValue: AppRootValue = {
|
||||
audioContextState,
|
||||
appGuiSettingState
|
||||
};
|
||||
|
||||
return <AppRootContext.Provider value={providerValue}>{children}</AppRootContext.Provider>;
|
||||
};
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { ClientState } from "@dannadori/voice-changer-client-js";
|
||||
import React, { useContext, useEffect, useRef } from "react";
|
||||
import { ReactNode } from "react";
|
||||
import { AppGuiSettingStateAndMethod, userAppGuiSetting } from "../001_globalHooks/001_useAppGuiSetting";
|
||||
import { useVCClient } from "../001_globalHooks/001_useVCClient";
|
||||
import { useAppRoot } from "./001_AppRootProvider";
|
||||
|
||||
@ -12,7 +11,6 @@ type Props = {
|
||||
type AppStateValue = ClientState & {
|
||||
audioContext: AudioContext
|
||||
initializedRef: React.MutableRefObject<boolean>
|
||||
appGuiSettingState: AppGuiSettingStateAndMethod
|
||||
}
|
||||
|
||||
const AppStateContext = React.createContext<AppStateValue | null>(null);
|
||||
@ -26,8 +24,8 @@ export const useAppState = (): AppStateValue => {
|
||||
|
||||
export const AppStateProvider = ({ children }: Props) => {
|
||||
const appRoot = useAppRoot()
|
||||
const clientState = useVCClient({ audioContext: appRoot.audioContextState.audioContext })
|
||||
const appGuiSettingState = userAppGuiSetting()
|
||||
const clientState = useVCClient({ audioContext: appRoot.audioContextState.audioContext, clientType: appRoot.appGuiSettingState.appGuiSetting.id })
|
||||
|
||||
|
||||
const initializedRef = useRef<boolean>(false)
|
||||
useEffect(() => {
|
||||
@ -61,17 +59,12 @@ export const AppStateProvider = ({ children }: Props) => {
|
||||
}
|
||||
}, [clientState.clientState.initialized])
|
||||
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const modelType = params.get("modelType") || ""
|
||||
appGuiSettingState.getAppSetting(`/assets/gui_settings/${modelType}.json`)
|
||||
}, [])
|
||||
|
||||
|
||||
const providerValue: AppStateValue = {
|
||||
audioContext: appRoot.audioContextState.audioContext!,
|
||||
...clientState.clientState,
|
||||
initializedRef,
|
||||
appGuiSettingState
|
||||
};
|
||||
|
||||
return <AppStateContext.Provider value={providerValue}>{children}</AppStateContext.Provider>;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import React from "react"
|
||||
import { AUDIO_ELEMENT_FOR_PLAY_RESULT, AUDIO_ELEMENT_FOR_TEST_CONVERTED, AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK, AUDIO_ELEMENT_FOR_TEST_ORIGINAL } from "../../const";
|
||||
import { GuiStateProvider } from "./001_GuiStateProvider";
|
||||
import { Dialogs } from "./900_Dialogs";
|
||||
import { TitleArea } from "./100_TitleArea";
|
||||
|
@ -1,11 +1,11 @@
|
||||
import React, { useMemo } from "react";
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider";
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider";
|
||||
import { isDesktopApp } from "../../const";
|
||||
import { useGuiState } from "./001_GuiStateProvider";
|
||||
|
||||
|
||||
export const Title = () => {
|
||||
const { appGuiSettingState } = useAppState()
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const guiState = useGuiState()
|
||||
const titleSetting = appGuiSettingState.appGuiSetting.front.title
|
||||
|
||||
|
@ -2,10 +2,12 @@ import React, { useMemo } from "react";
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider";
|
||||
import { useIndexedDB } from "@dannadori/voice-changer-client-js";
|
||||
import { INDEXEDDB_KEY_AUDIO_OUTPUT } from "../../const";
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider";
|
||||
|
||||
export const ClearSettingRow = () => {
|
||||
const appState = useAppState()
|
||||
const clientType = appState.appGuiSettingState.appGuiSetting.id
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const clientType = appGuiSettingState.appGuiSetting.id
|
||||
const { removeItem } = useIndexedDB({ clientType: clientType })
|
||||
|
||||
|
||||
|
@ -1,8 +1,15 @@
|
||||
import React, { useMemo } from "react"
|
||||
import React, { useMemo, useEffect } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useGuiState } from "./001_GuiStateProvider"
|
||||
|
||||
export const ModelUploaderRow = () => {
|
||||
const guiState = useGuiState()
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
useEffect(() => {
|
||||
if (appGuiSettingState.appGuiSetting.front.modelSetting.showPyTorchDefault) {
|
||||
guiState.setShowPyTorchModelUpload(true)
|
||||
}
|
||||
}, [])
|
||||
|
||||
const modelUploaderRow = useMemo(() => {
|
||||
return (
|
||||
|
@ -2,10 +2,13 @@ import React, { useMemo } from "react"
|
||||
import { fileSelector } from "@dannadori/voice-changer-client-js"
|
||||
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
|
||||
export const ONNXSelectRow = () => {
|
||||
const appState = useAppState()
|
||||
const modelSetting = appState.appGuiSettingState.appGuiSetting.front.modelSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
|
||||
const modelSetting = appGuiSettingState.appGuiSetting.front.modelSetting
|
||||
|
||||
const onnxSelectRow = useMemo(() => {
|
||||
if (!modelSetting.ONNXEnable) {
|
||||
|
@ -3,10 +3,12 @@ import { fileSelector } from "@dannadori/voice-changer-client-js"
|
||||
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { useGuiState } from "./001_GuiStateProvider"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
|
||||
export const PyTorchSelectRow = () => {
|
||||
const appState = useAppState()
|
||||
const modelSetting = appState.appGuiSettingState.appGuiSetting.front.modelSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const modelSetting = appGuiSettingState.appGuiSetting.front.modelSetting
|
||||
const guiState = useGuiState()
|
||||
|
||||
const pyTorchSelectRow = useMemo(() => {
|
||||
|
@ -2,10 +2,12 @@ import React, { useMemo } from "react"
|
||||
import { fileSelector, Correspondence } from "@dannadori/voice-changer-client-js"
|
||||
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
|
||||
export const CorrespondenceSelectRow = () => {
|
||||
const appState = useAppState()
|
||||
const modelSetting = appState.appGuiSettingState.appGuiSetting.front.modelSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const modelSetting = appGuiSettingState.appGuiSetting.front.modelSetting
|
||||
|
||||
const CorrespondenceSelectRow = useMemo(() => {
|
||||
if (!modelSetting.MMVCCorrespondense) {
|
||||
|
@ -2,10 +2,12 @@ import React, { useMemo } from "react"
|
||||
import { fileSelector } from "@dannadori/voice-changer-client-js"
|
||||
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
|
||||
export const PyTorchClusterSelectRow = () => {
|
||||
const appState = useAppState()
|
||||
const modelSetting = appState.appGuiSettingState.appGuiSetting.front.modelSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const modelSetting = appGuiSettingState.appGuiSetting.front.modelSetting
|
||||
|
||||
const pyTorchSelectRow = useMemo(() => {
|
||||
if (!modelSetting.pyTorchClusterEnable) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
import React, { useMemo, useEffect } from "react"
|
||||
import { useGuiState } from "./001_GuiStateProvider"
|
||||
import { useIndexedDB } from "@dannadori/voice-changer-client-js"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { AUDIO_ELEMENT_FOR_PLAY_RESULT, AUDIO_ELEMENT_FOR_TEST_CONVERTED_ECHOBACK, AUDIO_ELEMENT_FOR_TEST_ORIGINAL, INDEXEDDB_KEY_AUDIO_OUTPUT } from "../../const"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
|
||||
export const AudioOutputRow = () => {
|
||||
const guiState = useGuiState()
|
||||
const appState = useAppState()
|
||||
const clientType = appState.appGuiSettingState.appGuiSetting.id
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const clientType = appGuiSettingState.appGuiSetting.id
|
||||
const { getItem, setItem } = useIndexedDB({ clientType: clientType })
|
||||
|
||||
|
||||
|
@ -1,10 +1,12 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { F0Detector } from "@dannadori/voice-changer-client-js";
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider";
|
||||
|
||||
export const F0DetectorRow = () => {
|
||||
const appState = useAppState()
|
||||
const qualityControlSetting = appState.appGuiSettingState.appGuiSetting.front.qualityControl
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const qualityControlSetting = appGuiSettingState.appGuiSetting.front.qualityControl
|
||||
const f0DetectorRow = useMemo(() => {
|
||||
if (!qualityControlSetting.F0DetectorEnable) {
|
||||
return <></>
|
||||
|
@ -1,9 +1,11 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const SrcIdRow = () => {
|
||||
const appState = useAppState()
|
||||
const speakerSetting = appState.appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const speakerSetting = appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
|
||||
const srcIdRow = useMemo(() => {
|
||||
if (!speakerSetting.srcIdEnable) {
|
||||
|
@ -1,14 +1,17 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
import { ServerInfoSoVitsSVC } from "@dannadori/voice-changer-client-js";
|
||||
export const DstIdRow = () => {
|
||||
const appState = useAppState()
|
||||
const speakerSetting = appState.appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const clientId = appGuiSettingState.appGuiSetting.id
|
||||
|
||||
const dstIdRow = useMemo(() => {
|
||||
if (speakerSetting.showSpeakerF0) {
|
||||
if (clientId != "MMVCv13") {
|
||||
return <></>
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="body-row split-3-2-1-4 left-padding-1 guided">
|
||||
<div className="body-item-title left-padding-1">Destination Speaker Id</div>
|
||||
@ -31,10 +34,8 @@ export const DstIdRow = () => {
|
||||
)
|
||||
}, [appState.serverSetting.serverSetting, appState.clientSetting.clientSetting.speakers, appState.serverSetting.updateServerSettings])
|
||||
|
||||
|
||||
|
||||
const dstIdRowWithF0 = useMemo(() => {
|
||||
if (!speakerSetting.showSpeakerF0) {
|
||||
if (clientId != "MMVCv15") {
|
||||
return <></>
|
||||
}
|
||||
const selected = appState.clientSetting.clientSetting.correspondences?.find(x => {
|
||||
@ -63,16 +64,45 @@ export const DstIdRow = () => {
|
||||
<div className="body-item-text"></div>
|
||||
</div>
|
||||
)
|
||||
|
||||
|
||||
|
||||
}, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings, appState.clientSetting.clientSetting.correspondences])
|
||||
|
||||
const dstIdRowFromServer = useMemo(() => {
|
||||
const settings = appState.serverSetting.serverSetting as ServerInfoSoVitsSVC
|
||||
const speakers = settings.speakers
|
||||
if (!speakers) {
|
||||
return <></>
|
||||
}
|
||||
|
||||
const currentValue = Object.values(speakers).includes(appState.serverSetting.serverSetting.dstId) ? appState.serverSetting.serverSetting.dstId : -1
|
||||
|
||||
return (
|
||||
<div className="body-row split-3-2-1-4 left-padding-1 guided">
|
||||
<div className="body-item-title left-padding-1">Destination Speaker Id</div>
|
||||
<div className="body-select-container">
|
||||
<select className="body-select" value={currentValue} onChange={(e) => {
|
||||
appState.serverSetting.updateServerSettings({ ...appState.serverSetting.serverSetting, dstId: Number(e.target.value) })
|
||||
|
||||
}}>
|
||||
<option key="unknown" value={0}>default(0)</option>
|
||||
{
|
||||
Object.keys(speakers).map(x => {
|
||||
return <option key={x} value={speakers[x]}>{x}({speakers[x]})</option>
|
||||
})
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div className="body-item-text">
|
||||
</div>
|
||||
<div className="body-item-text"></div>
|
||||
</div>
|
||||
)
|
||||
}, [appState.serverSetting.serverSetting, appState.serverSetting.updateServerSettings, appState.clientSetting.clientSetting.correspondences])
|
||||
|
||||
return (
|
||||
<>
|
||||
{dstIdRow}
|
||||
{dstIdRowWithF0}
|
||||
{dstIdRowFromServer}
|
||||
</>
|
||||
)
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
import React, { useMemo, useState } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const EditSpeakerIdMappingRow = () => {
|
||||
const appState = useAppState()
|
||||
const speakerSetting = appState.appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const speakerSetting = appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
const [editSpeakerTargetId, setEditSpeakerTargetId] = useState<number>(0)
|
||||
const [editSpeakerTargetName, setEditSpeakerTargetName] = useState<string>("")
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const F0FactorRow = () => {
|
||||
const appState = useAppState()
|
||||
const speakerSetting = appState.appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const speakerSetting = appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
|
||||
const f0FactorRow = useMemo(() => {
|
||||
if (!speakerSetting.f0FactorEnable) {
|
||||
|
@ -1,9 +1,11 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const TuneRow = () => {
|
||||
const appState = useAppState()
|
||||
const speakerSetting = appState.appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const speakerSetting = appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
|
||||
const tuneRow = useMemo(() => {
|
||||
if (!speakerSetting.tuningEnable) {
|
||||
|
@ -1,9 +1,12 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const ClusterInferRatioRow = () => {
|
||||
const appState = useAppState()
|
||||
const speakerSetting = appState.appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
|
||||
const speakerSetting = appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
|
||||
const clusterRatioRow = useMemo(() => {
|
||||
if (!speakerSetting.clusterInferRationEnable) {
|
||||
|
@ -1,9 +1,11 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const NoiseScaleRow = () => {
|
||||
const appState = useAppState()
|
||||
const speakerSetting = appState.appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const speakerSetting = appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
|
||||
const noiseScaleRow = useMemo(() => {
|
||||
if (!speakerSetting.noiseScaleEnable) {
|
||||
|
@ -1,9 +1,12 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const SilentThresholdRow = () => {
|
||||
const appState = useAppState()
|
||||
const speakerSetting = appState.appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
|
||||
const speakerSetting = appGuiSettingState.appGuiSetting.front.speakerSetting
|
||||
|
||||
const silentThresholdRow = useMemo(() => {
|
||||
if (!speakerSetting.silentThresholdEnable) {
|
||||
|
@ -1,9 +1,11 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const ExtraDataLengthRow = () => {
|
||||
const appState = useAppState()
|
||||
const converterSetting = appState.appGuiSettingState.appGuiSetting.front.converterSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const converterSetting = appGuiSettingState.appGuiSetting.front.converterSetting
|
||||
|
||||
|
||||
const extraDataLengthRow = useMemo(() => {
|
||||
|
@ -1,9 +1,11 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const ServerURLRow = () => {
|
||||
const appState = useAppState()
|
||||
const advancedSetting = appState.appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const advancedSetting = appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
|
||||
const serverUrlRow = useMemo(() => {
|
||||
if (!advancedSetting.serverURLEnable) {
|
||||
|
@ -1,10 +1,12 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { Protocol } from "@dannadori/voice-changer-client-js"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
|
||||
export const ProtocolRow = () => {
|
||||
const appState = useAppState()
|
||||
const advancedSetting = appState.appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const advancedSetting = appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
|
||||
const protocolRow = useMemo(() => {
|
||||
if (!advancedSetting.protocolEnable) {
|
||||
|
@ -1,10 +1,12 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { SampleRate } from "@dannadori/voice-changer-client-js"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
|
||||
export const SampleRateRow = () => {
|
||||
const appState = useAppState()
|
||||
const advancedSetting = appState.appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const advancedSetting = appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
|
||||
const sampleRateRow = useMemo(() => {
|
||||
if (!advancedSetting.sampleRateEnable) {
|
||||
|
@ -1,10 +1,13 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { InputSampleRate } from "@dannadori/voice-changer-client-js"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
|
||||
export const SendingSampleRateRow = () => {
|
||||
const appState = useAppState()
|
||||
const advancedSetting = appState.appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
|
||||
const advancedSetting = appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
|
||||
const sendingSampleRateRow = useMemo(() => {
|
||||
if (!advancedSetting.sendingSampleRateEnable) {
|
||||
|
@ -1,10 +1,13 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { CrossFadeOverlapSize } from "@dannadori/voice-changer-client-js"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
|
||||
export const CrossFadeOverlapSizeRow = () => {
|
||||
const appState = useAppState()
|
||||
const advancedSetting = appState.appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
|
||||
const advancedSetting = appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
|
||||
const crossFadeOverlapSizeRow = useMemo(() => {
|
||||
if (!advancedSetting.crossFadeOverlapSizeEnable) {
|
||||
|
@ -1,9 +1,12 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const CrossFadeOffsetRateRow = () => {
|
||||
const appState = useAppState()
|
||||
const advancedSetting = appState.appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
|
||||
const advancedSetting = appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
|
||||
const crossFadeOffsetRateRow = useMemo(() => {
|
||||
if (!advancedSetting.crossFadeOffsetRateEnable) {
|
||||
|
@ -1,9 +1,12 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const CrossFadeEndRateRow = () => {
|
||||
const appState = useAppState()
|
||||
const advancedSetting = appState.appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
|
||||
const advancedSetting = appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
|
||||
const crossFadeEndRateRow = useMemo(() => {
|
||||
if (!advancedSetting.crossFadeEndRateEnable) {
|
||||
|
@ -1,10 +1,13 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
import { DownSamplingMode } from "@dannadori/voice-changer-client-js"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
|
||||
export const DownSamplingModeRow = () => {
|
||||
const appState = useAppState()
|
||||
const advancedSetting = appState.appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
|
||||
const advancedSetting = appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
|
||||
const downSamplingModeRow = useMemo(() => {
|
||||
if (!advancedSetting.downSamplingModeEnable) {
|
||||
|
@ -1,9 +1,12 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider"
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider"
|
||||
|
||||
export const TrancateNumTresholdRow = () => {
|
||||
const appState = useAppState()
|
||||
const advancedSetting = appState.appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
|
||||
const advancedSetting = appGuiSettingState.appGuiSetting.front.advancedSetting
|
||||
|
||||
const trancateNumTresholdRow = useMemo(() => {
|
||||
if (!advancedSetting.trancateNumTresholdEnable) {
|
||||
|
@ -1,10 +1,10 @@
|
||||
import React, { useMemo } from "react";
|
||||
import { useAppState } from "../../001_provider/001_AppStateProvider";
|
||||
import { useAppRoot } from "../../001_provider/001_AppRootProvider";
|
||||
import { useGuiState } from "./001_GuiStateProvider";
|
||||
|
||||
|
||||
export const LicenseDialog = () => {
|
||||
const { appGuiSettingState } = useAppState()
|
||||
const { appGuiSettingState } = useAppRoot()
|
||||
const guiState = useGuiState()
|
||||
const licenses = appGuiSettingState.appGuiSetting.dialogs.license
|
||||
|
||||
|
@ -35,6 +35,23 @@ def setModelType(_modelType: str):
|
||||
|
||||
|
||||
def getFrontendPath():
|
||||
if modelType == "MMVCv15":
|
||||
frontend_path = os.path.join(sys._MEIPASS, "dist_v13") if hasattr(sys, "_MEIPASS") else "../client/demo_v13/dist"
|
||||
elif modelType == "MMVCv13":
|
||||
frontend_path = os.path.join(sys._MEIPASS, "dist_v13") if hasattr(sys, "_MEIPASS") else "../client/demo_v13/dist"
|
||||
elif modelType == "so-vits-svc-40":
|
||||
frontend_path = os.path.join(sys._MEIPASS, "dist_v13") if hasattr(sys, "_MEIPASS") else "../client/demo_v13/dist"
|
||||
elif modelType == "so-vits-svc-40v2":
|
||||
frontend_path = os.path.join(sys._MEIPASS, "dist_v13") if hasattr(sys, "_MEIPASS") else "../client/demo_v13/dist"
|
||||
elif modelType == "DDSP-SVC":
|
||||
frontend_path = os.path.join(sys._MEIPASS, "dist_v13") if hasattr(sys, "_MEIPASS") else "../client/demo_v13/dist"
|
||||
elif modelType == "so-vits-svc-40_c":
|
||||
frontend_path = os.path.join(sys._MEIPASS, "dist_v13") if hasattr(sys, "_MEIPASS") \
|
||||
else "../client/demo_v13/dist"
|
||||
return frontend_path
|
||||
|
||||
|
||||
def getFrontendPath2():
|
||||
if modelType == "MMVCv15":
|
||||
frontend_path = os.path.join(sys._MEIPASS, "dist_v15") if hasattr(sys, "_MEIPASS") else "../client/demo_v15/dist"
|
||||
elif modelType == "MMVCv13":
|
||||
|
Loading…
Reference in New Issue
Block a user