This commit is contained in:
w-okada 2024-02-28 23:23:22 +09:00
parent bc6e8a9c08
commit 2ac5ec9feb
7 changed files with 424 additions and 426 deletions

11
client/.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"workbench.colorCustomizations": {
"tab.activeBackground": "#65952acc"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.printWidth": 1024,
"prettier.tabWidth": 4,
"files.associations": {
"*.css": "postcss"
}
}

View File

@ -1,8 +1,11 @@
{ {
"files.associations": {
"*.css": "postcss"
},
"workbench.colorCustomizations": { "workbench.colorCustomizations": {
"tab.activeBackground": "#65952acc" "tab.activeBackground": "#65952acc"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.printWidth": 1024,
"prettier.tabWidth": 4,
"files.associations": {
"*.css": "postcss"
} }
} }

View File

@ -1,4 +1,4 @@
import React from "react" import React from "react";
import { GuiStateProvider } from "./001_GuiStateProvider"; import { GuiStateProvider } from "./001_GuiStateProvider";
import { Dialogs } from "./900_Dialogs"; import { Dialogs } from "./900_Dialogs";
import { ModelSlotControl } from "./b00_ModelSlotControl"; import { ModelSlotControl } from "./b00_ModelSlotControl";
@ -13,5 +13,5 @@ export const Demo = () => {
<ModelSlotControl></ModelSlotControl> <ModelSlotControl></ModelSlotControl>
</div> </div>
</GuiStateProvider> </GuiStateProvider>
) );
} };

View File

@ -4,5 +4,8 @@
}, },
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.printWidth": 1024, "prettier.printWidth": 1024,
"prettier.tabWidth": 4 "prettier.tabWidth": 4,
"files.associations": {
"*.css": "postcss"
}
} }

View File

@ -15,8 +15,7 @@ export const VoiceChangerType = {
WebModel: "WebModel", WebModel: "WebModel",
EasyVC: "EasyVC", EasyVC: "EasyVC",
} as const; } as const;
export type VoiceChangerType = export type VoiceChangerType = (typeof VoiceChangerType)[keyof typeof VoiceChangerType];
(typeof VoiceChangerType)[keyof typeof VoiceChangerType];
export const StaticModel = { export const StaticModel = {
BeatriceJVS: "Beatrice-JVS", BeatriceJVS: "Beatrice-JVS",
@ -31,16 +30,14 @@ export const InputSampleRate = {
"44100": 44100, "44100": 44100,
"24000": 24000, "24000": 24000,
} as const; } as const;
export type InputSampleRate = export type InputSampleRate = (typeof InputSampleRate)[keyof typeof InputSampleRate];
(typeof InputSampleRate)[keyof typeof InputSampleRate];
export const ModelSamplingRate = { export const ModelSamplingRate = {
"48000": 48000, "48000": 48000,
"40000": 40000, "40000": 40000,
"32000": 32000, "32000": 32000,
} as const; } as const;
export type ModelSamplingRate = export type ModelSamplingRate = (typeof InputSampleRate)[keyof typeof InputSampleRate];
(typeof InputSampleRate)[keyof typeof InputSampleRate];
export const CrossFadeOverlapSize = { export const CrossFadeOverlapSize = {
"128": 128, "128": 128,
@ -50,8 +47,7 @@ export const CrossFadeOverlapSize = {
"2048": 2048, "2048": 2048,
"4096": 4096, "4096": 4096,
} as const; } as const;
export type CrossFadeOverlapSize = export type CrossFadeOverlapSize = (typeof CrossFadeOverlapSize)[keyof typeof CrossFadeOverlapSize];
(typeof CrossFadeOverlapSize)[keyof typeof CrossFadeOverlapSize];
export const F0Detector = { export const F0Detector = {
dio: "dio", dio: "dio",
@ -146,8 +142,7 @@ export const ServerSettingKey = {
inputSampleRate: "inputSampleRate", inputSampleRate: "inputSampleRate",
enableDirectML: "enableDirectML", enableDirectML: "enableDirectML",
} as const; } as const;
export type ServerSettingKey = export type ServerSettingKey = (typeof ServerSettingKey)[keyof typeof ServerSettingKey];
(typeof ServerSettingKey)[keyof typeof ServerSettingKey];
export type VoiceChangerServerSetting = { export type VoiceChangerServerSetting = {
passThrough: boolean; passThrough: boolean;
@ -323,16 +318,7 @@ export type WebModelSlot = ModelSlot & {
samplingRate: number; samplingRate: number;
}; };
export type ModelSlotUnion = export type ModelSlotUnion = RVCModelSlot | MMVCv13ModelSlot | MMVCv15ModelSlot | SoVitsSvc40ModelSlot | DDSPSVCModelSlot | DiffusionSVCModelSlot | BeatriceModelSlot | LLVCModelSlot | WebModelSlot;
| RVCModelSlot
| MMVCv13ModelSlot
| MMVCv15ModelSlot
| SoVitsSvc40ModelSlot
| DDSPSVCModelSlot
| DiffusionSVCModelSlot
| BeatriceModelSlot
| LLVCModelSlot
| WebModelSlot;
type ServerAudioDevice = { type ServerAudioDevice = {
kind: "audioinput" | "audiooutput"; kind: "audioinput" | "audiooutput";
@ -486,15 +472,13 @@ export const SendingSampleRate = {
"44100": 44100, "44100": 44100,
"24000": 24000, "24000": 24000,
} as const; } as const;
export type SendingSampleRate = export type SendingSampleRate = (typeof SendingSampleRate)[keyof typeof SendingSampleRate];
(typeof SendingSampleRate)[keyof typeof SendingSampleRate];
export const DownSamplingMode = { export const DownSamplingMode = {
decimate: "decimate", decimate: "decimate",
average: "average", average: "average",
} as const; } as const;
export type DownSamplingMode = export type DownSamplingMode = (typeof DownSamplingMode)[keyof typeof DownSamplingMode];
(typeof DownSamplingMode)[keyof typeof DownSamplingMode];
export type WorkletNodeSetting = { export type WorkletNodeSetting = {
serverUrl: string; serverUrl: string;
@ -569,11 +553,9 @@ export const VOICE_CHANGER_CLIENT_EXCEPTION = {
ERR_SIO_INVALID_RESPONSE: "ERR_SIO_INVALID_RESPONSE", ERR_SIO_INVALID_RESPONSE: "ERR_SIO_INVALID_RESPONSE",
ERR_REST_INVALID_RESPONSE: "ERR_REST_INVALID_RESPONSE", ERR_REST_INVALID_RESPONSE: "ERR_REST_INVALID_RESPONSE",
ERR_MIC_STREAM_NOT_INITIALIZED: "ERR_MIC_STREAM_NOT_INITIALIZED", ERR_MIC_STREAM_NOT_INITIALIZED: "ERR_MIC_STREAM_NOT_INITIALIZED",
ERR_INTERNAL_AUDIO_PROCESS_CALLBACK_IS_NOT_INITIALIZED: ERR_INTERNAL_AUDIO_PROCESS_CALLBACK_IS_NOT_INITIALIZED: "ERR_INTERNAL_AUDIO_PROCESS_CALLBACK_IS_NOT_INITIALIZED",
"ERR_INTERNAL_AUDIO_PROCESS_CALLBACK_IS_NOT_INITIALIZED",
} as const; } as const;
export type VOICE_CHANGER_CLIENT_EXCEPTION = export type VOICE_CHANGER_CLIENT_EXCEPTION = (typeof VOICE_CHANGER_CLIENT_EXCEPTION)[keyof typeof VOICE_CHANGER_CLIENT_EXCEPTION];
(typeof VOICE_CHANGER_CLIENT_EXCEPTION)[keyof typeof VOICE_CHANGER_CLIENT_EXCEPTION];
//////////////////////////////////// ////////////////////////////////////
// indexedDB // indexedDB
@ -582,8 +564,7 @@ export const INDEXEDDB_DB_APP_NAME = "INDEXEDDB_KEY_VOICE_CHANGER";
export const INDEXEDDB_DB_NAME = "INDEXEDDB_KEY_VOICE_CHANGER_DB"; export const INDEXEDDB_DB_NAME = "INDEXEDDB_KEY_VOICE_CHANGER_DB";
export const INDEXEDDB_KEY_CLIENT = "INDEXEDDB_KEY_VOICE_CHANGER_LIB_CLIENT"; export const INDEXEDDB_KEY_CLIENT = "INDEXEDDB_KEY_VOICE_CHANGER_LIB_CLIENT";
export const INDEXEDDB_KEY_SERVER = "INDEXEDDB_KEY_VOICE_CHANGER_LIB_SERVER"; export const INDEXEDDB_KEY_SERVER = "INDEXEDDB_KEY_VOICE_CHANGER_LIB_SERVER";
export const INDEXEDDB_KEY_MODEL_DATA = export const INDEXEDDB_KEY_MODEL_DATA = "INDEXEDDB_KEY_VOICE_CHANGER_LIB_MODEL_DATA";
"INDEXEDDB_KEY_VOICE_CHANGER_LIB_MODEL_DATA";
// ONNX // ONNX
export type OnnxExporterInfo = { export type OnnxExporterInfo = {

View File

@ -184,8 +184,8 @@ class EasyVC(VoiceChangerModel):
logger.info("[Voice Changer] Pipeline is not initialized.") logger.info("[Voice Changer] Pipeline is not initialized.")
raise PipelineNotInitializedException() raise PipelineNotInitializedException()
enableTimer = True enableTimer = False
with Timer2("infer_easyvc", enableTimer) as t: with Timer2("infer-easyvc", enableTimer) as t:
# 処理は16Kで実施(Pitch, embed, (infer)) # 処理は16Kで実施(Pitch, embed, (infer))
receivedData = cast( receivedData = cast(
@ -203,7 +203,7 @@ class EasyVC(VoiceChangerModel):
# 入力データ生成 # 入力データ生成
data = self.generate_input(receivedData, crossfade_frame, sola_search_frame, extra_frame) data = self.generate_input(receivedData, crossfade_frame, sola_search_frame, extra_frame)
t.record("generate_input") t.record("generate-input")
audio = data[0] audio = data[0]
pitchf = data[1] pitchf = data[1]

View File

@ -138,7 +138,7 @@ class Pipeline(object):
# print(f"pipeline exec input, audio:{audio.shape}, pitchf:{pitchf.shape}, feature:{feature.shape}") # print(f"pipeline exec input, audio:{audio.shape}, pitchf:{pitchf.shape}, feature:{feature.shape}")
# print(f"pipeline exec input, silence_front:{silence_front}, out_size:{out_size}") # print(f"pipeline exec input, silence_front:{silence_front}, out_size:{out_size}")
enablePipelineTimer = True enablePipelineTimer = False
with Timer2("Pipeline-Exec", enablePipelineTimer) as t: # NOQA with Timer2("Pipeline-Exec", enablePipelineTimer) as t: # NOQA
# 16000のサンプリングレートで入ってきている。以降この世界は16000で処理。 # 16000のサンプリングレートで入ってきている。以降この世界は16000で処理。
# self.t_pad = self.sr * repeat # 1秒 # self.t_pad = self.sr * repeat # 1秒