2023-01-04 20:28:36 +03:00
|
|
|
|
|
|
|
// (★1) chunk sizeは 128サンプル, 256byte(int16)と定義。
|
|
|
|
// (★2) 256byte(最低バッファサイズ256から間引いた個数x2byte)をchunkとして管理。
|
2023-01-11 21:49:22 +03:00
|
|
|
// 24000sample -> 1sec, 128sample(1chunk) -> 5.333msec
|
2023-01-11 22:52:01 +03:00
|
|
|
// 187.5chunk -> 1sec
|
2023-01-04 20:28:36 +03:00
|
|
|
|
2023-03-09 00:47:11 +03:00
|
|
|
export const ClientType = {
|
|
|
|
"MMVCv15": "MMVCv15",
|
|
|
|
"MMVCv13": "MMVCv13",
|
2023-04-05 12:08:06 +03:00
|
|
|
"so-vits-svc-40": "so-vits-svc-40",
|
|
|
|
"so-vits-svc-40_c": "so-vits-svc-40_c",
|
2023-04-05 20:31:10 +03:00
|
|
|
"so-vits-svc-40v2": "so-vits-svc-40v2",
|
2023-04-16 15:34:00 +03:00
|
|
|
"DDSP-SVC": "DDSP-SVC",
|
2023-04-05 20:31:10 +03:00
|
|
|
"RVC": "RVC"
|
2023-03-15 02:56:17 +03:00
|
|
|
|
2023-03-09 00:47:11 +03:00
|
|
|
} as const
|
|
|
|
export type ClientType = typeof ClientType[keyof typeof ClientType]
|
|
|
|
|
2023-02-19 04:12:25 +03:00
|
|
|
///////////////////////
|
|
|
|
// サーバセッティング
|
|
|
|
///////////////////////
|
|
|
|
export const InputSampleRate = {
|
|
|
|
"48000": 48000,
|
2023-03-14 20:39:34 +03:00
|
|
|
"44100": 44100,
|
2023-02-19 04:12:25 +03:00
|
|
|
"24000": 24000
|
|
|
|
} as const
|
|
|
|
export type InputSampleRate = typeof InputSampleRate[keyof typeof InputSampleRate]
|
|
|
|
|
2023-04-07 22:39:04 +03:00
|
|
|
export const ModelSamplingRate = {
|
|
|
|
"48000": 48000,
|
|
|
|
"40000": 40000,
|
|
|
|
"32000": 32000
|
|
|
|
} as const
|
|
|
|
export type ModelSamplingRate = typeof InputSampleRate[keyof typeof InputSampleRate]
|
|
|
|
|
|
|
|
|
2023-02-19 04:12:25 +03:00
|
|
|
export const CrossFadeOverlapSize = {
|
|
|
|
"1024": 1024,
|
|
|
|
"2048": 2048,
|
|
|
|
"4096": 4096,
|
|
|
|
} as const
|
|
|
|
export type CrossFadeOverlapSize = typeof CrossFadeOverlapSize[keyof typeof CrossFadeOverlapSize]
|
2023-02-14 16:32:25 +03:00
|
|
|
|
2023-02-19 00:25:22 +03:00
|
|
|
|
2023-02-19 04:12:25 +03:00
|
|
|
export const OnnxExecutionProvider = {
|
|
|
|
"CPUExecutionProvider": "CPUExecutionProvider",
|
|
|
|
"CUDAExecutionProvider": "CUDAExecutionProvider",
|
|
|
|
"DmlExecutionProvider": "DmlExecutionProvider",
|
|
|
|
"OpenVINOExecutionProvider": "OpenVINOExecutionProvider",
|
|
|
|
} as const
|
|
|
|
export type OnnxExecutionProvider = typeof OnnxExecutionProvider[keyof typeof OnnxExecutionProvider]
|
|
|
|
|
|
|
|
export const Framework = {
|
|
|
|
"PyTorch": "PyTorch",
|
|
|
|
"ONNX": "ONNX",
|
|
|
|
} as const
|
|
|
|
export type Framework = typeof Framework[keyof typeof Framework]
|
|
|
|
|
|
|
|
export const F0Detector = {
|
|
|
|
"dio": "dio",
|
|
|
|
"harvest": "harvest",
|
2023-04-28 23:39:53 +03:00
|
|
|
// "parselmouth": "parselmouth",
|
2023-04-16 15:34:00 +03:00
|
|
|
"crepe": "crepe",
|
2023-02-19 04:12:25 +03:00
|
|
|
} as const
|
|
|
|
export type F0Detector = typeof F0Detector[keyof typeof F0Detector]
|
|
|
|
|
2023-02-19 13:22:00 +03:00
|
|
|
|
|
|
|
|
2023-02-19 04:12:25 +03:00
|
|
|
export const ServerSettingKey = {
|
|
|
|
"srcId": "srcId",
|
|
|
|
"dstId": "dstId",
|
|
|
|
"gpu": "gpu",
|
2023-01-12 15:42:02 +03:00
|
|
|
|
2023-02-19 04:12:25 +03:00
|
|
|
"crossFadeOffsetRate": "crossFadeOffsetRate",
|
|
|
|
"crossFadeEndRate": "crossFadeEndRate",
|
|
|
|
"crossFadeOverlapSize": "crossFadeOverlapSize",
|
|
|
|
|
|
|
|
"framework": "framework",
|
|
|
|
"onnxExecutionProvider": "onnxExecutionProvider",
|
|
|
|
|
|
|
|
"f0Factor": "f0Factor",
|
|
|
|
"f0Detector": "f0Detector",
|
|
|
|
"recordIO": "recordIO",
|
|
|
|
|
2023-05-06 22:18:18 +03:00
|
|
|
"enableServerAudio": "enableServerAudio",
|
|
|
|
"serverAudioStated": "serverAudioStated",
|
|
|
|
"serverInputAudioSampleRate": "serverInputAudioSampleRate",
|
|
|
|
"serverOutputAudioSampleRate": "serverOutputAudioSampleRate",
|
|
|
|
"serverInputAudioBufferSize": "serverInputAudioBufferSize",
|
|
|
|
"serverOutputAudioBufferSize": "serverOutputAudioBufferSize",
|
|
|
|
"serverInputDeviceId": "serverInputDeviceId",
|
|
|
|
"serverOutputDeviceId": "serverOutputDeviceId",
|
|
|
|
"serverReadChunkSize": "serverReadChunkSize",
|
|
|
|
|
2023-03-11 02:21:16 +03:00
|
|
|
"tran": "tran",
|
2023-04-20 11:17:43 +03:00
|
|
|
"noiseScale": "noiseScale",
|
2023-03-11 02:21:16 +03:00
|
|
|
"predictF0": "predictF0",
|
|
|
|
"silentThreshold": "silentThreshold",
|
2023-03-12 20:06:39 +03:00
|
|
|
"extraConvertSize": "extraConvertSize",
|
2023-03-13 23:18:37 +03:00
|
|
|
"clusterInferRatio": "clusterInferRatio",
|
2023-03-11 02:21:16 +03:00
|
|
|
|
2023-04-07 21:11:37 +03:00
|
|
|
"indexRatio": "indexRatio",
|
2023-04-07 22:39:04 +03:00
|
|
|
"rvcQuality": "rvcQuality",
|
|
|
|
"modelSamplingRate": "modelSamplingRate",
|
2023-04-19 01:57:19 +03:00
|
|
|
"silenceFront": "silenceFront",
|
2023-04-21 09:48:12 +03:00
|
|
|
"modelSlotIndex": "modelSlotIndex",
|
2023-04-07 22:39:04 +03:00
|
|
|
|
2023-04-16 15:34:00 +03:00
|
|
|
"enableEnhancer": "enableEnhancer",
|
|
|
|
"enhancerTune": "enhancerTune",
|
2023-04-07 21:11:37 +03:00
|
|
|
|
2023-02-19 04:12:25 +03:00
|
|
|
"inputSampleRate": "inputSampleRate",
|
2023-05-04 17:50:52 +03:00
|
|
|
|
|
|
|
"enableDirectML": "enableDirectML",
|
2023-02-19 04:12:25 +03:00
|
|
|
} as const
|
|
|
|
export type ServerSettingKey = typeof ServerSettingKey[keyof typeof ServerSettingKey]
|
|
|
|
|
|
|
|
|
|
|
|
export type VoiceChangerServerSetting = {
|
2023-01-04 20:28:36 +03:00
|
|
|
srcId: number,
|
|
|
|
dstId: number,
|
|
|
|
gpu: number,
|
|
|
|
|
|
|
|
crossFadeOffsetRate: number,
|
|
|
|
crossFadeEndRate: number,
|
2023-02-19 04:12:25 +03:00
|
|
|
crossFadeOverlapSize: CrossFadeOverlapSize,
|
2023-01-07 14:07:39 +03:00
|
|
|
|
2023-01-12 10:38:45 +03:00
|
|
|
framework: Framework
|
|
|
|
onnxExecutionProvider: OnnxExecutionProvider,
|
2023-02-10 18:59:44 +03:00
|
|
|
|
|
|
|
f0Factor: number
|
2023-02-19 04:12:25 +03:00
|
|
|
f0Detector: F0Detector // dio or harvest
|
2023-02-14 23:02:51 +03:00
|
|
|
recordIO: number // 0:off, 1:on
|
2023-02-19 04:12:25 +03:00
|
|
|
|
2023-05-06 22:18:18 +03:00
|
|
|
enableServerAudio: number // 0:off, 1:on
|
|
|
|
serverAudioStated: number // 0:off, 1:on
|
|
|
|
serverInputAudioSampleRate: number
|
|
|
|
serverOutputAudioSampleRate: number
|
|
|
|
serverInputAudioBufferSize: number
|
|
|
|
serverOutputAudioBufferSize: number
|
|
|
|
serverInputDeviceId: number
|
|
|
|
serverOutputDeviceId: number
|
|
|
|
serverReadChunkSize: number
|
|
|
|
|
|
|
|
|
2023-03-11 02:21:16 +03:00
|
|
|
tran: number // so-vits-svc
|
2023-04-20 11:17:43 +03:00
|
|
|
noiseScale: number // so-vits-svc
|
2023-03-11 02:21:16 +03:00
|
|
|
predictF0: number // so-vits-svc
|
|
|
|
silentThreshold: number // so-vits-svc
|
2023-03-12 20:06:39 +03:00
|
|
|
extraConvertSize: number// so-vits-svc
|
2023-03-13 23:18:37 +03:00
|
|
|
clusterInferRatio: number // so-vits-svc
|
2023-03-11 02:21:16 +03:00
|
|
|
|
2023-04-07 21:11:37 +03:00
|
|
|
indexRatio: number // RVC
|
2023-04-07 22:39:04 +03:00
|
|
|
rvcQuality: number // 0:low, 1:high
|
2023-04-19 01:57:19 +03:00
|
|
|
silenceFront: number // 0:off, 1:on
|
2023-04-07 22:39:04 +03:00
|
|
|
modelSamplingRate: ModelSamplingRate // 32000,40000,48000
|
2023-04-21 09:48:12 +03:00
|
|
|
modelSlotIndex: number,
|
2023-04-07 21:11:37 +03:00
|
|
|
|
2023-04-16 15:34:00 +03:00
|
|
|
enableEnhancer: number // DDSP-SVC
|
|
|
|
enhancerTune: number // DDSP-SVC
|
|
|
|
|
2023-02-18 14:53:15 +03:00
|
|
|
inputSampleRate: InputSampleRate
|
2023-05-04 17:50:52 +03:00
|
|
|
enableDirectML: number
|
2023-01-04 20:28:36 +03:00
|
|
|
}
|
|
|
|
|
2023-04-25 10:59:58 +03:00
|
|
|
type ModelSlot = {
|
|
|
|
onnxModelFile: string,
|
|
|
|
pyTorchModelFile: string
|
|
|
|
featureFile: string,
|
|
|
|
indexFile: string,
|
|
|
|
|
|
|
|
defaultTrans: number,
|
|
|
|
|
|
|
|
modelType: number,
|
|
|
|
embChannels: number,
|
|
|
|
f0: boolean,
|
|
|
|
samplingRate: number
|
|
|
|
deprecated: boolean
|
|
|
|
}
|
|
|
|
|
2023-05-06 22:18:18 +03:00
|
|
|
type ServerAudioDevice = {
|
|
|
|
kind: "audioinput" | "audiooutput",
|
|
|
|
index: number,
|
|
|
|
name: string
|
|
|
|
hostAPI: string
|
|
|
|
}
|
|
|
|
|
2023-02-19 04:12:25 +03:00
|
|
|
export type ServerInfo = VoiceChangerServerSetting & {
|
|
|
|
status: string
|
|
|
|
configFile: string,
|
|
|
|
pyTorchModelFile: string,
|
|
|
|
onnxModelFile: string,
|
|
|
|
onnxExecutionProviders: OnnxExecutionProvider[]
|
2023-04-25 10:59:58 +03:00
|
|
|
modelSlots: ModelSlot[]
|
2023-05-06 22:18:18 +03:00
|
|
|
serverAudioInputDevices: ServerAudioDevice[]
|
|
|
|
serverAudioOutputDevices: ServerAudioDevice[]
|
|
|
|
|
2023-02-19 04:12:25 +03:00
|
|
|
}
|
|
|
|
|
2023-03-14 04:44:05 +03:00
|
|
|
export type ServerInfoSoVitsSVC = ServerInfo & {
|
|
|
|
speakers: { [key: string]: number }
|
|
|
|
}
|
2023-04-20 11:17:43 +03:00
|
|
|
|
|
|
|
export const DefaultServerSetting: ServerInfo = {
|
|
|
|
// VC Common
|
|
|
|
inputSampleRate: 48000,
|
2023-02-19 04:12:25 +03:00
|
|
|
|
2023-02-20 22:07:43 +03:00
|
|
|
crossFadeOffsetRate: 0.0,
|
|
|
|
crossFadeEndRate: 1.0,
|
|
|
|
crossFadeOverlapSize: CrossFadeOverlapSize[1024],
|
2023-02-19 04:12:25 +03:00
|
|
|
|
2023-03-09 00:55:57 +03:00
|
|
|
recordIO: 0,
|
|
|
|
|
2023-05-06 22:18:18 +03:00
|
|
|
enableServerAudio: 0,
|
|
|
|
serverAudioStated: 0,
|
|
|
|
serverInputAudioSampleRate: 48000,
|
|
|
|
serverOutputAudioSampleRate: 48000,
|
|
|
|
serverInputAudioBufferSize: 1024 * 24,
|
|
|
|
serverOutputAudioBufferSize: 1024 * 24,
|
|
|
|
serverInputDeviceId: -1,
|
|
|
|
serverOutputDeviceId: -1,
|
|
|
|
serverReadChunkSize: 256,
|
2023-03-11 02:21:16 +03:00
|
|
|
|
2023-04-20 11:17:43 +03:00
|
|
|
// VC Specific
|
|
|
|
srcId: 0,
|
|
|
|
dstId: 1,
|
2023-03-09 00:55:57 +03:00
|
|
|
gpu: 0,
|
|
|
|
|
|
|
|
|
2023-04-20 11:17:43 +03:00
|
|
|
framework: Framework.PyTorch,
|
2023-03-09 00:55:57 +03:00
|
|
|
f0Factor: 1.0,
|
|
|
|
onnxExecutionProvider: OnnxExecutionProvider.CPUExecutionProvider,
|
|
|
|
f0Detector: F0Detector.dio,
|
|
|
|
|
2023-03-11 02:21:16 +03:00
|
|
|
tran: 0,
|
2023-04-20 11:17:43 +03:00
|
|
|
noiseScale: 0,
|
2023-03-11 02:21:16 +03:00
|
|
|
predictF0: 0,
|
|
|
|
silentThreshold: 0,
|
2023-03-12 20:06:39 +03:00
|
|
|
extraConvertSize: 0,
|
2023-03-13 23:18:37 +03:00
|
|
|
clusterInferRatio: 0,
|
2023-03-11 02:21:16 +03:00
|
|
|
|
2023-04-07 21:11:37 +03:00
|
|
|
indexRatio: 0,
|
2023-04-07 22:39:04 +03:00
|
|
|
rvcQuality: 0,
|
|
|
|
modelSamplingRate: 48000,
|
2023-04-20 11:17:43 +03:00
|
|
|
silenceFront: 1,
|
2023-04-21 09:48:12 +03:00
|
|
|
modelSlotIndex: 0,
|
2023-04-07 22:39:04 +03:00
|
|
|
|
2023-04-16 15:34:00 +03:00
|
|
|
enableEnhancer: 0,
|
|
|
|
enhancerTune: 0,
|
2023-04-07 21:11:37 +03:00
|
|
|
|
2023-05-04 17:50:52 +03:00
|
|
|
enableDirectML: 0,
|
2023-03-09 00:55:57 +03:00
|
|
|
//
|
|
|
|
status: "ok",
|
|
|
|
configFile: "",
|
|
|
|
pyTorchModelFile: "",
|
|
|
|
onnxModelFile: "",
|
2023-04-21 09:48:12 +03:00
|
|
|
onnxExecutionProviders: [],
|
2023-05-06 22:18:18 +03:00
|
|
|
modelSlots: [],
|
|
|
|
serverAudioInputDevices: [],
|
|
|
|
serverAudioOutputDevices: []
|
2023-03-09 00:55:57 +03:00
|
|
|
}
|
2023-04-20 11:17:43 +03:00
|
|
|
export const DefaultServerSetting_MMVCv15: ServerInfo = {
|
|
|
|
...DefaultServerSetting, dstId: 101,
|
|
|
|
}
|
|
|
|
export const DefaultServerSetting_MMVCv13: ServerInfo = {
|
|
|
|
...DefaultServerSetting, srcId: 107, dstId: 100,
|
|
|
|
}
|
2023-03-09 00:55:57 +03:00
|
|
|
|
2023-03-18 19:43:36 +03:00
|
|
|
export const DefaultServerSetting_so_vits_svc_40: ServerInfo = {
|
2023-04-20 11:17:43 +03:00
|
|
|
...DefaultServerSetting, tran: 10, noiseScale: 0.3, extraConvertSize: 1024 * 32, clusterInferRatio: 0.1,
|
2023-03-18 19:43:36 +03:00
|
|
|
}
|
|
|
|
|
2023-04-05 12:08:06 +03:00
|
|
|
export const DefaultServerSetting_so_vits_svc_40_c: ServerInfo = {
|
2023-04-20 11:17:43 +03:00
|
|
|
...DefaultServerSetting, tran: 10, noiseScale: 0.3, extraConvertSize: 1024 * 32, clusterInferRatio: 0.1,
|
2023-04-05 12:08:06 +03:00
|
|
|
}
|
2023-03-11 02:37:41 +03:00
|
|
|
export const DefaultServerSetting_so_vits_svc_40v2: ServerInfo = {
|
2023-04-20 11:17:43 +03:00
|
|
|
...DefaultServerSetting, tran: 10, noiseScale: 0.3, extraConvertSize: 1024 * 32, clusterInferRatio: 0.1,
|
2023-04-16 15:34:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export const DefaultServerSetting_DDSP_SVC: ServerInfo = {
|
2023-04-20 11:17:43 +03:00
|
|
|
...DefaultServerSetting, dstId: 1, tran: 10, extraConvertSize: 1024 * 32, clusterInferRatio: 0.1, enableEnhancer: 1
|
2023-02-19 04:12:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-04-05 22:03:09 +03:00
|
|
|
export const DefaultServerSetting_RVC: ServerInfo = {
|
2023-04-21 09:48:12 +03:00
|
|
|
...DefaultServerSetting, tran: 10, extraConvertSize: 1024 * 32, f0Detector: F0Detector.harvest
|
2023-04-05 22:03:09 +03:00
|
|
|
}
|
|
|
|
|
2023-02-19 04:12:25 +03:00
|
|
|
///////////////////////
|
|
|
|
// Workletセッティング
|
|
|
|
///////////////////////
|
|
|
|
|
2023-01-11 22:52:01 +03:00
|
|
|
export type WorkletSetting = {
|
|
|
|
numTrancateTreshold: number,
|
|
|
|
volTrancateThreshold: number,
|
|
|
|
volTrancateLength: number
|
|
|
|
}
|
2023-02-19 08:20:37 +03:00
|
|
|
export const DefaultWorkletSetting: WorkletSetting = {
|
2023-02-19 22:49:34 +03:00
|
|
|
numTrancateTreshold: 100,
|
2023-02-19 08:20:37 +03:00
|
|
|
volTrancateThreshold: 0.0005,
|
|
|
|
volTrancateLength: 32
|
2023-02-17 22:15:34 +03:00
|
|
|
}
|
2023-02-19 08:20:37 +03:00
|
|
|
///////////////////////
|
2023-02-19 20:21:51 +03:00
|
|
|
// Worklet Nodeセッティング
|
2023-02-19 08:20:37 +03:00
|
|
|
///////////////////////
|
2023-01-05 05:45:42 +03:00
|
|
|
export const Protocol = {
|
2023-01-04 20:28:36 +03:00
|
|
|
"sio": "sio",
|
|
|
|
"rest": "rest",
|
|
|
|
} as const
|
2023-01-05 05:45:42 +03:00
|
|
|
export type Protocol = typeof Protocol[keyof typeof Protocol]
|
2023-01-04 20:28:36 +03:00
|
|
|
|
2023-02-19 08:20:37 +03:00
|
|
|
export const SendingSampleRate = {
|
|
|
|
"48000": 48000,
|
2023-03-14 20:39:34 +03:00
|
|
|
"44100": 44100,
|
2023-02-19 08:20:37 +03:00
|
|
|
"24000": 24000
|
2023-01-04 20:28:36 +03:00
|
|
|
} as const
|
2023-02-19 08:20:37 +03:00
|
|
|
export type SendingSampleRate = typeof SendingSampleRate[keyof typeof SendingSampleRate]
|
2023-01-04 20:28:36 +03:00
|
|
|
|
2023-02-14 16:32:25 +03:00
|
|
|
export const DownSamplingMode = {
|
|
|
|
"decimate": "decimate",
|
|
|
|
"average": "average"
|
|
|
|
} as const
|
|
|
|
export type DownSamplingMode = typeof DownSamplingMode[keyof typeof DownSamplingMode]
|
|
|
|
|
2023-02-19 08:20:37 +03:00
|
|
|
|
2023-02-19 20:21:51 +03:00
|
|
|
export type WorkletNodeSetting = {
|
2023-02-19 08:20:37 +03:00
|
|
|
serverUrl: string,
|
|
|
|
protocol: Protocol,
|
|
|
|
sendingSampleRate: SendingSampleRate,
|
|
|
|
inputChunkNum: number,
|
|
|
|
downSamplingMode: DownSamplingMode,
|
|
|
|
}
|
2023-02-19 20:21:51 +03:00
|
|
|
export const DefaultWorkletNodeSetting: WorkletNodeSetting = {
|
2023-02-19 08:20:37 +03:00
|
|
|
serverUrl: "",
|
|
|
|
protocol: "sio",
|
2023-04-20 11:17:43 +03:00
|
|
|
sendingSampleRate: 48000,
|
2023-02-19 08:20:37 +03:00
|
|
|
inputChunkNum: 48,
|
|
|
|
downSamplingMode: "average"
|
|
|
|
}
|
|
|
|
|
2023-03-18 19:43:36 +03:00
|
|
|
export const DefaultWorkletNodeSetting_so_vits_svc_40: WorkletNodeSetting = {
|
2023-04-20 11:17:43 +03:00
|
|
|
...DefaultWorkletNodeSetting, inputChunkNum: 128,
|
2023-03-18 19:43:36 +03:00
|
|
|
}
|
|
|
|
|
2023-03-12 18:54:49 +03:00
|
|
|
export const DefaultWorkletNodeSetting_so_vits_svc_40v2: WorkletNodeSetting = {
|
2023-04-20 11:17:43 +03:00
|
|
|
...DefaultWorkletNodeSetting, inputChunkNum: 128,
|
2023-03-12 18:54:49 +03:00
|
|
|
}
|
|
|
|
|
2023-04-16 15:34:00 +03:00
|
|
|
export const DefaultWorkletNodeSetting_DDSP_SVC: WorkletNodeSetting = {
|
2023-04-20 11:17:43 +03:00
|
|
|
...DefaultWorkletNodeSetting, inputChunkNum: 256,
|
2023-04-16 15:34:00 +03:00
|
|
|
}
|
2023-04-05 22:03:09 +03:00
|
|
|
|
|
|
|
export const DefaultWorkletNodeSetting_RVC: WorkletNodeSetting = {
|
2023-04-20 11:17:43 +03:00
|
|
|
...DefaultWorkletNodeSetting, inputChunkNum: 256,
|
2023-04-05 22:03:09 +03:00
|
|
|
}
|
|
|
|
|
2023-02-19 08:20:37 +03:00
|
|
|
///////////////////////
|
|
|
|
// クライアントセッティング
|
|
|
|
///////////////////////
|
2023-01-04 20:28:36 +03:00
|
|
|
export const SampleRate = {
|
|
|
|
"48000": 48000,
|
|
|
|
} as const
|
|
|
|
export type SampleRate = typeof SampleRate[keyof typeof SampleRate]
|
|
|
|
|
2023-02-19 13:22:00 +03:00
|
|
|
export type Speaker = {
|
|
|
|
"id": number,
|
|
|
|
"name": string,
|
|
|
|
}
|
|
|
|
export type Correspondence = {
|
|
|
|
"sid": number,
|
|
|
|
"correspondence": number,
|
|
|
|
"dirname": string
|
|
|
|
}
|
2023-02-19 08:20:37 +03:00
|
|
|
export type VoiceChangerClientSetting = {
|
|
|
|
audioInput: string | MediaStream | null,
|
|
|
|
sampleRate: SampleRate, // 48000Hz
|
|
|
|
echoCancel: boolean,
|
|
|
|
noiseSuppression: boolean,
|
|
|
|
noiseSuppression2: boolean
|
|
|
|
|
2023-02-19 13:22:00 +03:00
|
|
|
speakers: Speaker[],
|
|
|
|
correspondences: Correspondence[],
|
2023-02-19 08:20:37 +03:00
|
|
|
inputGain: number
|
|
|
|
outputGain: number
|
|
|
|
}
|
2023-01-05 05:45:42 +03:00
|
|
|
|
2023-01-12 10:38:45 +03:00
|
|
|
export const DefaultVoiceChangerClientSetting: VoiceChangerClientSetting = {
|
2023-01-05 12:35:56 +03:00
|
|
|
audioInput: null,
|
2023-01-05 05:45:42 +03:00
|
|
|
sampleRate: 48000,
|
2023-02-19 13:22:00 +03:00
|
|
|
speakers: [
|
|
|
|
{
|
|
|
|
"id": 0,
|
|
|
|
"name": "user"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 101,
|
|
|
|
"name": "ずんだもん"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 102,
|
|
|
|
"name": "そら"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 103,
|
|
|
|
"name": "めたん"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 104,
|
|
|
|
"name": "つむぎ"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
correspondences: [],
|
2023-02-19 17:55:05 +03:00
|
|
|
echoCancel: false,
|
|
|
|
noiseSuppression: false,
|
2023-02-14 23:02:51 +03:00
|
|
|
noiseSuppression2: false,
|
2023-02-12 12:19:22 +03:00
|
|
|
inputGain: 1.0,
|
|
|
|
outputGain: 1.0
|
2023-01-04 20:28:36 +03:00
|
|
|
}
|
|
|
|
|
2023-01-07 14:07:39 +03:00
|
|
|
|
2023-02-19 08:20:37 +03:00
|
|
|
////////////////////////////////////
|
|
|
|
// Exceptions
|
|
|
|
////////////////////////////////////
|
2023-01-05 05:45:42 +03:00
|
|
|
export const VOICE_CHANGER_CLIENT_EXCEPTION = {
|
|
|
|
ERR_SIO_CONNECT_FAILED: "ERR_SIO_CONNECT_FAILED",
|
|
|
|
ERR_SIO_INVALID_RESPONSE: "ERR_SIO_INVALID_RESPONSE",
|
2023-01-07 14:07:39 +03:00
|
|
|
ERR_REST_INVALID_RESPONSE: "ERR_REST_INVALID_RESPONSE",
|
|
|
|
ERR_MIC_STREAM_NOT_INITIALIZED: "ERR_MIC_STREAM_NOT_INITIALIZED"
|
2023-01-05 05:45:42 +03:00
|
|
|
|
|
|
|
} as const
|
|
|
|
export type VOICE_CHANGER_CLIENT_EXCEPTION = typeof VOICE_CHANGER_CLIENT_EXCEPTION[keyof typeof VOICE_CHANGER_CLIENT_EXCEPTION]
|
|
|
|
|
2023-01-04 20:28:36 +03:00
|
|
|
|
2023-01-29 03:42:45 +03:00
|
|
|
////////////////////////////////////
|
|
|
|
// indexedDB
|
|
|
|
////////////////////////////////////
|
2023-03-02 03:56:42 +03:00
|
|
|
export const INDEXEDDB_DB_APP_NAME = "INDEXEDDB_KEY_VOICE_CHANGER"
|
|
|
|
export const INDEXEDDB_DB_NAME = "INDEXEDDB_KEY_VOICE_CHANGER_DB"
|
2023-01-29 03:42:45 +03:00
|
|
|
export const INDEXEDDB_KEY_CLIENT = "INDEXEDDB_KEY_VOICE_CHANGER_LIB_CLIENT"
|
|
|
|
export const INDEXEDDB_KEY_SERVER = "INDEXEDDB_KEY_VOICE_CHANGER_LIB_SERVER"
|
2023-02-19 20:21:51 +03:00
|
|
|
export const INDEXEDDB_KEY_WORKLETNODE = "INDEXEDDB_KEY_VOICE_CHANGER_LIB_WORKLETNODE"
|
2023-01-29 09:25:44 +03:00
|
|
|
export const INDEXEDDB_KEY_MODEL_DATA = "INDEXEDDB_KEY_VOICE_CHANGER_LIB_MODEL_DATA"
|
|
|
|
export const INDEXEDDB_KEY_WORKLET = "INDEXEDDB_KEY_VOICE_CHANGER_LIB_WORKLET"
|
|
|
|
|
|
|
|
|
2023-04-13 02:00:28 +03:00
|
|
|
// ONNX
|
|
|
|
export type OnnxExporterInfo = {
|
|
|
|
"status": string
|
|
|
|
"path": string
|
|
|
|
"filename": string
|
2023-04-21 09:48:12 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-04-30 20:34:01 +03:00
|
|
|
export const MAX_MODEL_SLOT_NUM = 3
|
|
|
|
|
|
|
|
// Merge
|
|
|
|
export type MergeElement = {
|
|
|
|
filename: string
|
|
|
|
strength: number
|
|
|
|
}
|
|
|
|
export type MergeModelRequest = {
|
|
|
|
command: "mix",
|
2023-05-01 10:26:56 +03:00
|
|
|
defaultTrans: number,
|
2023-04-30 20:34:01 +03:00
|
|
|
files: MergeElement[]
|
|
|
|
}
|