add mmvcv15 corresondence reccomend
This commit is contained in:
parent
21967880c4
commit
d57362c3c3
@ -7,7 +7,7 @@
|
||||
"name": "headerArea",
|
||||
"options": {
|
||||
"mainTitle": "Realtime Voice Changer Client",
|
||||
"subTitle": "for RVC"
|
||||
"subTitle": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
|
8
client/demo/dist/index.js
vendored
8
client/demo/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -7,7 +7,7 @@
|
||||
"name": "headerArea",
|
||||
"options": {
|
||||
"mainTitle": "Realtime Voice Changer Client",
|
||||
"subTitle": "for RVC"
|
||||
"subTitle": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -121,6 +121,7 @@ export const FileUploaderScreen = (props: FileUploaderScreenProps) => {
|
||||
rows.push(generateFileRow(uploadSetting!, "Model", "mmvcv13Model", ["pth", "onnx"]))
|
||||
} else if (vcType == "MMVCv15") {
|
||||
rows.push(generateFileRow(uploadSetting!, "Config", "mmvcv15Config", ["json"]))
|
||||
rows.push(generateFileRow(uploadSetting!, "Corres", "mmvcv15Correspondence", ["txt"]))
|
||||
rows.push(generateFileRow(uploadSetting!, "Model", "mmvcv15Model", ["pth", "onnx"]))
|
||||
} else if (vcType == "so-vits-svc-40") {
|
||||
rows.push(generateFileRow(uploadSetting!, "Config", "soVitsSvc40Config", ["json"]))
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React, { useMemo } from "react"
|
||||
import { useAppState } from "../../../001_provider/001_AppStateProvider"
|
||||
import { MMVCv15ModelSlot } from "@dannadori/voice-changer-client-js"
|
||||
|
||||
export type SpeakerAreaProps = {
|
||||
}
|
||||
@ -25,26 +26,44 @@ export const F0FactorArea = (_props: SpeakerAreaProps) => {
|
||||
if (selected.voiceChangerType != "MMVCv15") {
|
||||
return <></>
|
||||
}
|
||||
const selectedMMVCv15 = selected as MMVCv15ModelSlot
|
||||
|
||||
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-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>
|
||||
</span>
|
||||
<span className="character-area-slider-control-val">{serverSetting.serverSetting.f0Factor}</span>
|
||||
<>
|
||||
<div className="character-area-control">
|
||||
<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>
|
||||
</span>
|
||||
<span className="character-area-slider-control-val">{serverSetting.serverSetting.f0Factor}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="character-area-control">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}, [serverSetting.serverSetting, serverSetting.updateServerSettings, selected])
|
||||
|
||||
|
@ -1324,6 +1324,9 @@ body {
|
||||
.character-area-slider-control-val {
|
||||
width: 3rem;
|
||||
}
|
||||
.character-area-slider-control-text {
|
||||
padding: 0px 1px 0px 1px;
|
||||
}
|
||||
}
|
||||
.character-area-buttons {
|
||||
display: flex;
|
||||
|
@ -218,7 +218,7 @@ export type MMVCv15ModelSlot = ModelSlot & {
|
||||
dstId: number
|
||||
f0Factor: number
|
||||
samplingRate: number
|
||||
|
||||
f0: { [key: number]: number }
|
||||
}
|
||||
|
||||
export type SoVitsSvc40ModelSlot = ModelSlot & {
|
||||
|
@ -13,6 +13,7 @@ export const ModelFileKind = {
|
||||
"mmvcv13Model": "mmvcv13Model",
|
||||
"mmvcv15Config": "mmvcv15Config",
|
||||
"mmvcv15Model": "mmvcv15Model",
|
||||
"mmvcv15Correspondence": "mmvcv15Correspondence",
|
||||
|
||||
"soVitsSvc40Config": "soVitsSvc40Config",
|
||||
"soVitsSvc40Model": "soVitsSvc40Model",
|
||||
|
@ -62,7 +62,8 @@ class MMVCv15ModelSlot(ModelSlot):
|
||||
f0Factor: float = 1.0
|
||||
isONNX: bool = False
|
||||
samplingRate: int = 24000
|
||||
speakers: dict = field(default_factory=lambda: {0: "user", 101: "zundamon", 102: "sora", 103: "methane", 104: "tsumugi"})
|
||||
speakers: dict = field(default_factory=lambda: {})
|
||||
f0: dict = field(default_factory=lambda: {})
|
||||
|
||||
|
||||
@dataclass
|
||||
|
@ -14,6 +14,22 @@ class MMVCv15ModelSlotGenerator(ModelSlotGenerator):
|
||||
slotInfo.modelFile = file.name
|
||||
elif file.kind == "mmvcv15Config":
|
||||
slotInfo.configFile = file.name
|
||||
elif file.kind == "mmvcv15Correspondence":
|
||||
with open(file.name, "r") as f:
|
||||
slotInfo.speakers = {}
|
||||
while True:
|
||||
line = f.readline()
|
||||
if not line:
|
||||
break
|
||||
vals = line.strip().split("|")
|
||||
if len(vals) != 3:
|
||||
break
|
||||
id = vals[0]
|
||||
f0 = vals[1]
|
||||
name = vals[2]
|
||||
slotInfo.speakers[id] = name
|
||||
slotInfo.f0[id] = f0
|
||||
|
||||
slotInfo.isONNX = slotInfo.modelFile.endswith(".onnx")
|
||||
slotInfo.name = os.path.splitext(os.path.basename(slotInfo.modelFile))[0]
|
||||
return slotInfo
|
||||
|
@ -8,6 +8,7 @@ LoadModelParamFileKind: TypeAlias = Literal[
|
||||
"mmvcv13Model",
|
||||
"mmvcv15Config",
|
||||
"mmvcv15Model",
|
||||
"mmvcv15Correspondence",
|
||||
"soVitsSvc40Config",
|
||||
"soVitsSvc40Model",
|
||||
"soVitsSvc40Cluster",
|
||||
|
Loading…
x
Reference in New Issue
Block a user