mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
update
This commit is contained in:
parent
6272936e14
commit
4f7969176f
2
.gitignore
vendored
2
.gitignore
vendored
@ -68,3 +68,5 @@ venv/
|
||||
|
||||
beatrice_internal_api.cp310-win_amd64.pyd
|
||||
108_average_110b_10.bin
|
||||
|
||||
server/model_dir_static/Beatrice-JVS
|
||||
|
@ -1,4 +1,11 @@
|
||||
cd ~/git-work/voice-changer-js/lib/ ; npm run build:dev; cd -
|
||||
# cd ~/git-work/voice-changer-js/lib/ ; npm run build:dev; cd -
|
||||
# rm -rf node_modules/@dannadori/voice-changer-js
|
||||
# mkdir -p node_modules/@dannadori/voice-changer-js/dist
|
||||
# cp -r ~/git-work/voice-changer-js/lib/package.json node_modules/@dannadori/voice-changer-js/
|
||||
# cp -r ~/git-work/voice-changer-js/lib/dist node_modules/@dannadori/voice-changer-js/
|
||||
|
||||
|
||||
cd ~/git-work/voice-changer-js/lib/ ; npm run build:prod; cd -
|
||||
rm -rf node_modules/@dannadori/voice-changer-js
|
||||
mkdir -p node_modules/@dannadori/voice-changer-js/dist
|
||||
cp -r ~/git-work/voice-changer-js/lib/package.json node_modules/@dannadori/voice-changer-js/
|
||||
|
@ -55,6 +55,7 @@ export const ModelSlotArea = (_props: ModelSlotAreaProps) => {
|
||||
);
|
||||
|
||||
const clickAction = async () => {
|
||||
// @ts-ignore
|
||||
const dummyModelSlotIndex = Math.floor(Date.now() / 1000) * 1000 + x.slotIndex;
|
||||
await serverSetting.updateServerSettings({ ...serverSetting.serverSetting, modelSlotIndex: dummyModelSlotIndex });
|
||||
setTimeout(() => {
|
||||
|
@ -1,55 +1,59 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider"
|
||||
|
||||
export type TuningAreaProps = {
|
||||
}
|
||||
import React, { useMemo } from "react";
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider";
|
||||
|
||||
export type TuningAreaProps = {};
|
||||
|
||||
export const TuningArea = (_props: TuningAreaProps) => {
|
||||
const { serverSetting } = useAppState()
|
||||
const { serverSetting } = useAppState();
|
||||
|
||||
const selected = useMemo(() => {
|
||||
if (serverSetting.serverSetting.modelSlotIndex == undefined) {
|
||||
return
|
||||
return;
|
||||
} else if (serverSetting.serverSetting.modelSlotIndex == "Beatrice-JVS") {
|
||||
const beatriceJVS = serverSetting.serverSetting.modelSlots.find((v) => v.slotIndex == "Beatrice-JVS");
|
||||
return beatriceJVS;
|
||||
} else {
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];
|
||||
}
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex]
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots])
|
||||
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);
|
||||
|
||||
const tuningArea = useMemo(() => {
|
||||
if (!selected) {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
if (selected.voiceChangerType == "MMVCv13" || selected.voiceChangerType == "MMVCv15") {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
|
||||
const currentTuning = serverSetting.serverSetting.tran
|
||||
const currentTuning = serverSetting.serverSetting.tran;
|
||||
const tranValueUpdatedAction = async (val: number) => {
|
||||
await serverSetting.updateServerSettings({ ...serverSetting.serverSetting, tran: val })
|
||||
}
|
||||
await serverSetting.updateServerSettings({ ...serverSetting.serverSetting, tran: val });
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="character-area-control">
|
||||
<div className="character-area-control-title">
|
||||
TUNE:
|
||||
</div>
|
||||
<div className="character-area-control-title">TUNE:</div>
|
||||
<div className="character-area-control-field">
|
||||
<div className="character-area-slider-control">
|
||||
<span className="character-area-slider-control-kind"></span>
|
||||
<span className="character-area-slider-control-slider">
|
||||
<input type="range" min="-50" max="50" step="1" value={currentTuning} onChange={(e) => {
|
||||
tranValueUpdatedAction(Number(e.target.value))
|
||||
}}></input>
|
||||
<input
|
||||
type="range"
|
||||
min="-50"
|
||||
max="50"
|
||||
step="1"
|
||||
value={currentTuning}
|
||||
onChange={(e) => {
|
||||
tranValueUpdatedAction(Number(e.target.value));
|
||||
}}
|
||||
></input>
|
||||
</span>
|
||||
<span className="character-area-slider-control-val">{currentTuning}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected])
|
||||
);
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);
|
||||
|
||||
|
||||
return tuningArea
|
||||
}
|
||||
return tuningArea;
|
||||
};
|
||||
|
@ -1,56 +1,59 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider"
|
||||
|
||||
export type IndexAreaProps = {
|
||||
}
|
||||
import React, { useMemo } from "react";
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider";
|
||||
|
||||
export type IndexAreaProps = {};
|
||||
|
||||
export const IndexArea = (_props: IndexAreaProps) => {
|
||||
const { serverSetting } = useAppState()
|
||||
const { serverSetting } = useAppState();
|
||||
|
||||
const selected = useMemo(() => {
|
||||
if (serverSetting.serverSetting.modelSlotIndex == undefined) {
|
||||
return
|
||||
return;
|
||||
} else if (serverSetting.serverSetting.modelSlotIndex == "Beatrice-JVS") {
|
||||
const beatriceJVS = serverSetting.serverSetting.modelSlots.find((v) => v.slotIndex == "Beatrice-JVS");
|
||||
return beatriceJVS;
|
||||
} else {
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];
|
||||
}
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex]
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots])
|
||||
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);
|
||||
|
||||
const indexArea = useMemo(() => {
|
||||
if (!selected) {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
if (selected.voiceChangerType != "RVC") {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
|
||||
const currentIndexRatio = serverSetting.serverSetting.indexRatio
|
||||
const currentIndexRatio = serverSetting.serverSetting.indexRatio;
|
||||
const indexRatioValueUpdatedAction = async (val: number) => {
|
||||
await serverSetting.updateServerSettings({ ...serverSetting.serverSetting, indexRatio: val })
|
||||
}
|
||||
await serverSetting.updateServerSettings({ ...serverSetting.serverSetting, indexRatio: val });
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="character-area-control">
|
||||
<div className="character-area-control-title">
|
||||
INDEX:
|
||||
</div>
|
||||
<div className="character-area-control-title">INDEX:</div>
|
||||
<div className="character-area-control-field">
|
||||
<div className="character-area-slider-control">
|
||||
<span className="character-area-slider-control-kind"></span>
|
||||
<span className="character-area-slider-control-slider">
|
||||
<input type="range" min="0" max="1" step="0.1" value={currentIndexRatio} onChange={(e) => {
|
||||
indexRatioValueUpdatedAction(Number(e.target.value))
|
||||
}}></input>
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="1"
|
||||
step="0.1"
|
||||
value={currentIndexRatio}
|
||||
onChange={(e) => {
|
||||
indexRatioValueUpdatedAction(Number(e.target.value));
|
||||
}}
|
||||
></input>
|
||||
</span>
|
||||
<span className="character-area-slider-control-val">{currentIndexRatio}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected])
|
||||
);
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);
|
||||
|
||||
|
||||
|
||||
return indexArea
|
||||
}
|
||||
return indexArea;
|
||||
};
|
||||
|
@ -1,113 +1,109 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider"
|
||||
|
||||
export type SpeakerAreaProps = {
|
||||
}
|
||||
import React, { useMemo } from "react";
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider";
|
||||
|
||||
export type SpeakerAreaProps = {};
|
||||
|
||||
export const SpeakerArea = (_props: SpeakerAreaProps) => {
|
||||
const { serverSetting } = useAppState()
|
||||
const { serverSetting } = useAppState();
|
||||
|
||||
const selected = useMemo(() => {
|
||||
if (serverSetting.serverSetting.modelSlotIndex == undefined) {
|
||||
return
|
||||
return;
|
||||
} else if (serverSetting.serverSetting.modelSlotIndex == "Beatrice-JVS") {
|
||||
const beatriceJVS = serverSetting.serverSetting.modelSlots.find((v) => v.slotIndex == "Beatrice-JVS");
|
||||
return beatriceJVS;
|
||||
} else {
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];
|
||||
}
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex]
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots])
|
||||
|
||||
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);
|
||||
|
||||
const srcArea = useMemo(() => {
|
||||
if (!selected) {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
|
||||
if (selected.voiceChangerType != "MMVCv13" && selected.voiceChangerType != "MMVCv15") {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
const options = Object.keys(selected.speakers).map(key => {
|
||||
const val = selected.speakers[Number(key)]
|
||||
const options = Object.keys(selected.speakers).map((key) => {
|
||||
const val = selected.speakers[Number(key)];
|
||||
return (
|
||||
<option key={key} value={key}>{val}[{key}]</option>
|
||||
)
|
||||
})
|
||||
<option key={key} value={key}>
|
||||
{val}[{key}]
|
||||
</option>
|
||||
);
|
||||
});
|
||||
|
||||
const srcSpeakerValueUpdatedAction = async (val: number) => {
|
||||
await serverSetting.updateServerSettings({ ...serverSetting.serverSetting, srcId: val })
|
||||
}
|
||||
await serverSetting.updateServerSettings({ ...serverSetting.serverSetting, srcId: val });
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="character-area-control">
|
||||
<div className="character-area-control-title">
|
||||
Voice:
|
||||
</div>
|
||||
<div className="character-area-control-title">Voice:</div>
|
||||
<div className="character-area-control-field">
|
||||
<div className="character-area-slider-control">
|
||||
<span className="character-area-slider-control-kind">src</span>
|
||||
<span className="character-area-slider-control-slider">
|
||||
<select value={serverSetting.serverSetting.srcId} onChange={(e) => { srcSpeakerValueUpdatedAction(Number(e.target.value)) }}>
|
||||
<select
|
||||
value={serverSetting.serverSetting.srcId}
|
||||
onChange={(e) => {
|
||||
srcSpeakerValueUpdatedAction(Number(e.target.value));
|
||||
}}
|
||||
>
|
||||
{options}
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected])
|
||||
|
||||
);
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);
|
||||
|
||||
const dstArea = useMemo(() => {
|
||||
if (!selected) {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
|
||||
const options = Object.keys(selected.speakers).map(key => {
|
||||
const val = selected.speakers[Number(key)]
|
||||
const options = Object.keys(selected.speakers).map((key) => {
|
||||
const val = selected.speakers[Number(key)];
|
||||
return (
|
||||
<option key={key} value={key}>{val}[{key}]</option>
|
||||
)
|
||||
})
|
||||
<option key={key} value={key}>
|
||||
{val}[{key}]
|
||||
</option>
|
||||
);
|
||||
});
|
||||
|
||||
const srcSpeakerValueUpdatedAction = async (val: number) => {
|
||||
await serverSetting.updateServerSettings({ ...serverSetting.serverSetting, dstId: val })
|
||||
}
|
||||
await serverSetting.updateServerSettings({ ...serverSetting.serverSetting, dstId: val });
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="character-area-control">
|
||||
<div className="character-area-control-title">
|
||||
{
|
||||
selected.voiceChangerType == "DDSP-SVC" ||
|
||||
selected.voiceChangerType == "so-vits-svc-40" ||
|
||||
selected.voiceChangerType == "RVC" ? "Voice:" : ""
|
||||
}
|
||||
</div>
|
||||
<div className="character-area-control-title">{selected.voiceChangerType == "DDSP-SVC" || selected.voiceChangerType == "so-vits-svc-40" || selected.voiceChangerType == "RVC" || selected.voiceChangerType == "Beatrice" ? "Voice:" : ""}</div>
|
||||
<div className="character-area-control-field">
|
||||
<div className="character-area-slider-control">
|
||||
<span className="character-area-slider-control-kind">
|
||||
{
|
||||
selected.voiceChangerType == "MMVCv13" ||
|
||||
selected.voiceChangerType == "MMVCv15" ? "dst" : ""
|
||||
}
|
||||
|
||||
</span>
|
||||
<span className="character-area-slider-control-kind">{selected.voiceChangerType == "MMVCv13" || selected.voiceChangerType == "MMVCv15" ? "dst" : ""}</span>
|
||||
<span className="character-area-slider-control-slider">
|
||||
<select value={serverSetting.serverSetting.dstId} onChange={(e) => { srcSpeakerValueUpdatedAction(Number(e.target.value)) }}>
|
||||
<select
|
||||
value={serverSetting.serverSetting.dstId}
|
||||
onChange={(e) => {
|
||||
srcSpeakerValueUpdatedAction(Number(e.target.value));
|
||||
}}
|
||||
>
|
||||
{options}
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected])
|
||||
|
||||
);
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{srcArea}
|
||||
{dstArea}
|
||||
</>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
@ -1,72 +1,70 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider"
|
||||
import { MMVCv15ModelSlot } from "@dannadori/voice-changer-client-js"
|
||||
|
||||
export type SpeakerAreaProps = {
|
||||
}
|
||||
import React, { useMemo } from "react";
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider";
|
||||
import { MMVCv15ModelSlot } from "@dannadori/voice-changer-client-js";
|
||||
|
||||
export type SpeakerAreaProps = {};
|
||||
|
||||
export const F0FactorArea = (_props: SpeakerAreaProps) => {
|
||||
const { serverSetting } = useAppState()
|
||||
const { serverSetting } = useAppState();
|
||||
|
||||
const selected = useMemo(() => {
|
||||
if (serverSetting.serverSetting.modelSlotIndex == undefined) {
|
||||
return
|
||||
return;
|
||||
} else if (serverSetting.serverSetting.modelSlotIndex == "Beatrice-JVS") {
|
||||
const beatriceJVS = serverSetting.serverSetting.modelSlots.find((v) => v.slotIndex == "Beatrice-JVS");
|
||||
return beatriceJVS;
|
||||
} else {
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];
|
||||
}
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex]
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots])
|
||||
|
||||
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);
|
||||
|
||||
const f0FactorArea = useMemo(() => {
|
||||
if (!selected) {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
|
||||
if (selected.voiceChangerType != "MMVCv15") {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
const selectedMMVCv15 = selected as MMVCv15ModelSlot
|
||||
const selectedMMVCv15 = selected as MMVCv15ModelSlot;
|
||||
|
||||
const recommendF0 = (selectedMMVCv15.f0[serverSetting.serverSetting.dstId] / selectedMMVCv15.f0[serverSetting.serverSetting.srcId]).toFixed(2)
|
||||
const recommendF0 = (selectedMMVCv15.f0[serverSetting.serverSetting.dstId] / selectedMMVCv15.f0[serverSetting.serverSetting.srcId]).toFixed(2);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="character-area-control">
|
||||
<div className="character-area-control-title">
|
||||
F0Factor:
|
||||
</div>
|
||||
<div className="character-area-control-title">F0Factor:</div>
|
||||
<div className="character-area-control-field">
|
||||
<div className="character-area-slider-control">
|
||||
<span className="character-area-slider-control-kind"></span>
|
||||
<span className="character-area-slider-control-slider">
|
||||
<input type="range" min="0.01" max="5.00" step="0.01" value={serverSetting.serverSetting.f0Factor} onChange={(e) => {
|
||||
serverSetting.updateServerSettings({ ...serverSetting.serverSetting, f0Factor: Number(e.target.value) })
|
||||
}}></input>
|
||||
<input
|
||||
type="range"
|
||||
min="0.01"
|
||||
max="5.00"
|
||||
step="0.01"
|
||||
value={serverSetting.serverSetting.f0Factor}
|
||||
onChange={(e) => {
|
||||
serverSetting.updateServerSettings({ ...serverSetting.serverSetting, f0Factor: Number(e.target.value) });
|
||||
}}
|
||||
></input>
|
||||
</span>
|
||||
<span className="character-area-slider-control-val">{serverSetting.serverSetting.f0Factor}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div className="character-area-control">
|
||||
<div className="character-area-control-title">
|
||||
|
||||
</div>
|
||||
<div className="character-area-control-title"></div>
|
||||
<div className="character-area-control-field">
|
||||
<div className="character-area-slider-control">
|
||||
<span className="character-area-slider-control-text">recommend:</span>
|
||||
<span className="character-area-slider-control-text">
|
||||
{recommendF0}
|
||||
</span>
|
||||
<span className="character-area-slider-control-text">{recommendF0}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected])
|
||||
);
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);
|
||||
|
||||
|
||||
return f0FactorArea
|
||||
}
|
||||
return f0FactorArea;
|
||||
};
|
||||
|
@ -1,81 +1,86 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider"
|
||||
|
||||
export type SoVitsSVC40SettingAreaProps = {
|
||||
}
|
||||
import React, { useMemo } from "react";
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider";
|
||||
|
||||
export type SoVitsSVC40SettingAreaProps = {};
|
||||
|
||||
export const SoVitsSVC40SettingArea = (_props: SoVitsSVC40SettingAreaProps) => {
|
||||
const { serverSetting } = useAppState()
|
||||
const { serverSetting } = useAppState();
|
||||
|
||||
const selected = useMemo(() => {
|
||||
if (serverSetting.serverSetting.modelSlotIndex == undefined) {
|
||||
return
|
||||
return;
|
||||
} else if (serverSetting.serverSetting.modelSlotIndex == "Beatrice-JVS") {
|
||||
const beatriceJVS = serverSetting.serverSetting.modelSlots.find((v) => v.slotIndex == "Beatrice-JVS");
|
||||
return beatriceJVS;
|
||||
} else {
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];
|
||||
}
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex]
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots])
|
||||
|
||||
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);
|
||||
|
||||
const settingArea = useMemo(() => {
|
||||
if (!selected) {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
|
||||
if (selected.voiceChangerType != "so-vits-svc-40") {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
|
||||
const cluster = (
|
||||
<div className="character-area-control">
|
||||
<div className="character-area-control-title">
|
||||
Cluster:
|
||||
</div>
|
||||
<div className="character-area-control-title">Cluster:</div>
|
||||
<div className="character-area-control-field">
|
||||
<div className="character-area-slider-control">
|
||||
<span className="character-area-slider-control-kind"></span>
|
||||
<span className="character-area-slider-control-slider">
|
||||
<input type="range" min="0" max="1.0" step="0.1" value={serverSetting.serverSetting.clusterInferRatio} onChange={(e) => {
|
||||
serverSetting.updateServerSettings({ ...serverSetting.serverSetting, clusterInferRatio: Number(e.target.value) })
|
||||
}}></input>
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="1.0"
|
||||
step="0.1"
|
||||
value={serverSetting.serverSetting.clusterInferRatio}
|
||||
onChange={(e) => {
|
||||
serverSetting.updateServerSettings({ ...serverSetting.serverSetting, clusterInferRatio: Number(e.target.value) });
|
||||
}}
|
||||
></input>
|
||||
</span>
|
||||
<span className="character-area-slider-control-val">{serverSetting.serverSetting.clusterInferRatio}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
const noise = (
|
||||
<div className="character-area-control">
|
||||
<div className="character-area-control-title">
|
||||
Noise:
|
||||
</div>
|
||||
<div className="character-area-control-title">Noise:</div>
|
||||
<div className="character-area-control-field">
|
||||
<div className="character-area-slider-control">
|
||||
<span className="character-area-slider-control-kind"></span>
|
||||
<span className="character-area-slider-control-slider">
|
||||
<input type="range" min="0" max="1.0" step="0.1" value={serverSetting.serverSetting.noiseScale} onChange={(e) => {
|
||||
serverSetting.updateServerSettings({ ...serverSetting.serverSetting, noiseScale: Number(e.target.value) })
|
||||
}}></input>
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="1.0"
|
||||
step="0.1"
|
||||
value={serverSetting.serverSetting.noiseScale}
|
||||
onChange={(e) => {
|
||||
serverSetting.updateServerSettings({ ...serverSetting.serverSetting, noiseScale: Number(e.target.value) });
|
||||
}}
|
||||
></input>
|
||||
</span>
|
||||
<span className="character-area-slider-control-val">{serverSetting.serverSetting.noiseScale}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{cluster}
|
||||
{noise}
|
||||
</>
|
||||
)
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected])
|
||||
);
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);
|
||||
|
||||
|
||||
return settingArea
|
||||
}
|
||||
return settingArea;
|
||||
};
|
||||
|
@ -1,81 +1,86 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider"
|
||||
|
||||
export type DDSPSVC30SettingAreaProps = {
|
||||
}
|
||||
import React, { useMemo } from "react";
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider";
|
||||
|
||||
export type DDSPSVC30SettingAreaProps = {};
|
||||
|
||||
export const DDSPSVC30SettingArea = (_props: DDSPSVC30SettingAreaProps) => {
|
||||
const { serverSetting } = useAppState()
|
||||
const { serverSetting } = useAppState();
|
||||
|
||||
const selected = useMemo(() => {
|
||||
if (serverSetting.serverSetting.modelSlotIndex == undefined) {
|
||||
return
|
||||
return;
|
||||
} else if (serverSetting.serverSetting.modelSlotIndex == "Beatrice-JVS") {
|
||||
const beatriceJVS = serverSetting.serverSetting.modelSlots.find((v) => v.slotIndex == "Beatrice-JVS");
|
||||
return beatriceJVS;
|
||||
} else {
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];
|
||||
}
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex]
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots])
|
||||
|
||||
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);
|
||||
|
||||
const settingArea = useMemo(() => {
|
||||
if (!selected) {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
|
||||
if (selected.voiceChangerType != "DDSP-SVC") {
|
||||
return <></>
|
||||
return <></>;
|
||||
}
|
||||
|
||||
const acc = (
|
||||
<div className="character-area-control">
|
||||
<div className="character-area-control-title">
|
||||
ACC:
|
||||
</div>
|
||||
<div className="character-area-control-title">ACC:</div>
|
||||
<div className="character-area-control-field">
|
||||
<div className="character-area-slider-control">
|
||||
<span className="character-area-slider-control-kind"></span>
|
||||
<span className="character-area-slider-control-slider">
|
||||
<input type="range" min="1" max="20" step="1" value={serverSetting.serverSetting.diffAcc} onChange={(e) => {
|
||||
serverSetting.updateServerSettings({ ...serverSetting.serverSetting, diffAcc: Number(e.target.value) })
|
||||
}}></input>
|
||||
<input
|
||||
type="range"
|
||||
min="1"
|
||||
max="20"
|
||||
step="1"
|
||||
value={serverSetting.serverSetting.diffAcc}
|
||||
onChange={(e) => {
|
||||
serverSetting.updateServerSettings({ ...serverSetting.serverSetting, diffAcc: Number(e.target.value) });
|
||||
}}
|
||||
></input>
|
||||
</span>
|
||||
<span className="character-area-slider-control-val">{serverSetting.serverSetting.diffAcc}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
const kstep = (
|
||||
<div className="character-area-control">
|
||||
<div className="character-area-control-title">
|
||||
Kstep:
|
||||
</div>
|
||||
<div className="character-area-control-title">Kstep:</div>
|
||||
<div className="character-area-control-field">
|
||||
<div className="character-area-slider-control">
|
||||
<span className="character-area-slider-control-kind"></span>
|
||||
<span className="character-area-slider-control-slider">
|
||||
<input type="range" min="21" max="300" step="1" value={serverSetting.serverSetting.kStep} onChange={(e) => {
|
||||
serverSetting.updateServerSettings({ ...serverSetting.serverSetting, kStep: Number(e.target.value) })
|
||||
}}></input>
|
||||
<input
|
||||
type="range"
|
||||
min="21"
|
||||
max="300"
|
||||
step="1"
|
||||
value={serverSetting.serverSetting.kStep}
|
||||
onChange={(e) => {
|
||||
serverSetting.updateServerSettings({ ...serverSetting.serverSetting, kStep: Number(e.target.value) });
|
||||
}}
|
||||
></input>
|
||||
</span>
|
||||
<span className="character-area-slider-control-val">{serverSetting.serverSetting.kStep}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{acc}
|
||||
{kstep}
|
||||
</>
|
||||
)
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected])
|
||||
);
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected]);
|
||||
|
||||
|
||||
return settingArea
|
||||
}
|
||||
return settingArea;
|
||||
};
|
||||
|
@ -10,8 +10,12 @@ export const DiffusionSVCSettingArea = (_props: DiffusionSVCSettingAreaProps) =>
|
||||
const selected = useMemo(() => {
|
||||
if (serverSetting.serverSetting.modelSlotIndex == undefined) {
|
||||
return;
|
||||
}
|
||||
} else if (serverSetting.serverSetting.modelSlotIndex == "Beatrice-JVS") {
|
||||
const beatriceJVS = serverSetting.serverSetting.modelSlots.find((v) => v.slotIndex == "Beatrice-JVS");
|
||||
return beatriceJVS;
|
||||
} else {
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];
|
||||
}
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);
|
||||
|
||||
const settingArea = useMemo(() => {
|
||||
|
@ -28,8 +28,12 @@ export const CharacterArea = (_props: CharacterAreaProps) => {
|
||||
const selected = useMemo(() => {
|
||||
if (serverSetting.serverSetting.modelSlotIndex == undefined) {
|
||||
return;
|
||||
}
|
||||
} else if (serverSetting.serverSetting.modelSlotIndex == "Beatrice-JVS") {
|
||||
const beatriceJVS = serverSetting.serverSetting.modelSlots.find((v) => v.slotIndex == "Beatrice-JVS");
|
||||
return beatriceJVS;
|
||||
} else {
|
||||
return serverSetting.serverSetting.modelSlots[serverSetting.serverSetting.modelSlotIndex];
|
||||
}
|
||||
}, [serverSetting.serverSetting.modelSlotIndex, serverSetting.serverSetting.modelSlots]);
|
||||
|
||||
useEffect(() => {
|
||||
@ -49,7 +53,8 @@ export const CharacterArea = (_props: CharacterAreaProps) => {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
const icon = selected.iconFile.length > 0 ? serverSetting.serverSetting.voiceChangerParams.model_dir + "/" + selected.slotIndex + "/" + selected.iconFile.split(/[\/\\]/).pop() : "./assets/icons/human.png";
|
||||
const modelDir = serverSetting.serverSetting.modelSlotIndex == "Beatrice-JVS" ? "model_dir_static" : serverSetting.serverSetting.voiceChangerParams.model_dir;
|
||||
const icon = selected.iconFile.length > 0 ? modelDir + "/" + selected.slotIndex + "/" + selected.iconFile.split(/[\/\\]/).pop() : "./assets/icons/human.png";
|
||||
const selectedTermOfUseUrlLink = selected.termsOfUseUrl ? (
|
||||
<a href={selected.termsOfUseUrl} target="_blank" rel="noopener noreferrer" className="portrait-area-terms-of-use-link">
|
||||
[{messageBuilderState.getMessage(__filename, "terms_of_use")}]
|
||||
|
@ -14,6 +14,11 @@ export const VoiceChangerType = {
|
||||
} as const;
|
||||
export type VoiceChangerType = (typeof VoiceChangerType)[keyof typeof VoiceChangerType];
|
||||
|
||||
export const StaticModel = {
|
||||
BeatriceJVS: "Beatrice-JVS",
|
||||
} as const;
|
||||
export type StaticModel = (typeof StaticModel)[keyof typeof StaticModel];
|
||||
|
||||
///////////////////////
|
||||
// サーバセッティング
|
||||
///////////////////////
|
||||
@ -174,7 +179,7 @@ export type VoiceChangerServerSetting = {
|
||||
rvcQuality: number; // 0:low, 1:high
|
||||
silenceFront: number; // 0:off, 1:on
|
||||
modelSamplingRate: ModelSamplingRate; // 32000,40000,48000
|
||||
modelSlotIndex: number;
|
||||
modelSlotIndex: number | StaticModel;
|
||||
|
||||
useEnhancer: number; // DDSP-SVC
|
||||
useDiff: number; // DDSP-SVC
|
||||
@ -194,7 +199,7 @@ export type VoiceChangerServerSetting = {
|
||||
};
|
||||
|
||||
type ModelSlot = {
|
||||
slotIndex: number;
|
||||
slotIndex: number | StaticModel;
|
||||
voiceChangerType: VoiceChangerType;
|
||||
name: string;
|
||||
description: string;
|
||||
|
@ -107,8 +107,6 @@ def getSampleJsonAndModelIds(mode: RVCSampleMode):
|
||||
("Amitaro_o", {"useIndex": False}),
|
||||
("KikotoMahiro_o", {"useIndex": False}),
|
||||
("TokinaShigure_o", {"useIndex": False}),
|
||||
("Amitaro_16k_o", {"useIndex": False}),
|
||||
("Amitaro_16k_nof0_o", {"useIndex": False}),
|
||||
]
|
||||
elif mode == "testAll":
|
||||
return [
|
||||
|
@ -142,7 +142,7 @@ def loadSlotInfo(model_dir: str, slotIndex: int | StaticSlot) -> ModelSlots:
|
||||
jsonFile = os.path.join(slotDir, "params.json")
|
||||
if not os.path.exists(jsonFile):
|
||||
return ModelSlot()
|
||||
jsonDict = json.load(open(os.path.join(slotDir, "params.json")))
|
||||
jsonDict = json.load(open(jsonFile, encoding="utf-8"))
|
||||
slotInfoKey = list(ModelSlot.__annotations__.keys())
|
||||
slotInfo = ModelSlot(**{k: v for k, v in jsonDict.items() if k in slotInfoKey})
|
||||
if slotInfo.voiceChangerType == "RVC":
|
||||
|
Loading…
Reference in New Issue
Block a user