2023-04-28 01:36:08 +03:00
|
|
|
from dataclasses import dataclass, field
|
|
|
|
|
|
|
|
from voice_changer.RVC.ModelSlot import ModelSlot
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class RVCSettings:
|
|
|
|
gpu: int = 0
|
|
|
|
dstId: int = 0
|
|
|
|
|
2023-05-04 06:21:34 +03:00
|
|
|
f0Detector: str = "harvest" # dio or harvest
|
2023-04-28 01:36:08 +03:00
|
|
|
tran: int = 20
|
|
|
|
silentThreshold: float = 0.00001
|
|
|
|
extraConvertSize: int = 1024 * 32
|
|
|
|
clusterInferRatio: float = 0.1
|
|
|
|
|
|
|
|
framework: str = "PyTorch" # PyTorch or ONNX
|
|
|
|
modelSlots: list[ModelSlot] = field(
|
2023-04-30 20:34:01 +03:00
|
|
|
default_factory=lambda: [ModelSlot(), ModelSlot(), ModelSlot(), ModelSlot()]
|
2023-04-28 01:36:08 +03:00
|
|
|
)
|
|
|
|
indexRatio: float = 0
|
|
|
|
rvcQuality: int = 0
|
|
|
|
silenceFront: int = 1 # 0:off, 1:on
|
|
|
|
modelSamplingRate: int = 48000
|
|
|
|
modelSlotIndex: int = -1
|
|
|
|
|
|
|
|
speakers: dict[str, int] = field(default_factory=lambda: {})
|
2023-05-02 14:57:12 +03:00
|
|
|
isHalf: int = 1 # 0:off, 1:on
|
2023-04-28 01:36:08 +03:00
|
|
|
# ↓mutableな物だけ列挙
|
|
|
|
intData = [
|
|
|
|
"gpu",
|
|
|
|
"dstId",
|
|
|
|
"tran",
|
|
|
|
"extraConvertSize",
|
|
|
|
"rvcQuality",
|
|
|
|
"modelSamplingRate",
|
|
|
|
"silenceFront",
|
|
|
|
"modelSlotIndex",
|
2023-05-02 14:57:12 +03:00
|
|
|
"isHalf",
|
2023-04-28 01:36:08 +03:00
|
|
|
]
|
|
|
|
floatData = ["silentThreshold", "indexRatio"]
|
|
|
|
strData = ["framework", "f0Detector"]
|