This commit is contained in:
w-okada 2023-11-03 10:17:45 +09:00
parent acc0130e7c
commit 4f534a2c44
14 changed files with 916 additions and 377 deletions

View File

@ -0,0 +1,5 @@
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/

View File

@ -22,7 +22,7 @@
"name": "configArea",
"options": {
"detectors": ["dio", "harvest", "crepe", "crepe_full", "crepe_tiny", "rmvpe", "rmvpe_onnx"],
"inputChunkNums": [1, 2, 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024, 2048]
"inputChunkNums": [1, 2, 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024, 2048, 4096, 8192, 16384]
}
}
]

View File

@ -1 +1,10 @@
<!doctype html><html style="width:100%;height:100%;overflow:hidden"><head><meta charset="utf-8"/><title>Voice Changer Client Demo</title><script defer="defer" src="index.js"></script></head><body style="width:100%;height:100%;margin:0"><div id="app" style="width:100%;height:100%"></div></body></html>
<!DOCTYPE html>
<html style="width: 100%; height: 100%; overflow: hidden">
<head>
<meta charset="utf-8" />
<title>Voice Changer Client Demo</title>
<script defer src="index.js"></script></head>
<body style="width: 100%; height: 100%; margin: 0px">
<div id="app" style="width: 100%; height: 100%"></div>
</body>
</html>

BIN
client/demo/dist/ort-wasm-simd.wasm vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -54,12 +54,16 @@
"webpack-dev-server": "^4.15.1"
},
"dependencies": {
"@alexanderolsen/libsamplerate-js": "^2.0.4",
"@dannadori/voice-changer-client-js": "^1.0.173",
"@dannadori/worker-manager": "^1.0.12",
"@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/free-brands-svg-icons": "^6.4.2",
"@fortawesome/free-regular-svg-icons": "^6.4.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@tensorflow/tfjs": "^4.11.0",
"onnxruntime-web": "^1.16.1",
"protobufjs": "^7.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"

View File

@ -22,7 +22,7 @@
"name": "configArea",
"options": {
"detectors": ["dio", "harvest", "crepe", "crepe_full", "crepe_tiny", "rmvpe", "rmvpe_onnx"],
"inputChunkNums": [1, 2, 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024, 2048]
"inputChunkNums": [1, 2, 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024, 2048, 4096, 8192, 16384]
}
}
]

View File

@ -13,7 +13,7 @@ export const ConvertArea = (props: ConvertProps) => {
const convertArea = useMemo(() => {
let nums: number[];
if (!props.inputChunkNums) {
nums = [8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024, 2048];
nums = [8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1024, 2048, 4096, 8192, 16384];
} else {
nums = props.inputChunkNums;
}

View File

@ -54,5 +54,18 @@ module.exports = {
new CopyPlugin({
patterns: [{ from: "public/favicon.ico", to: "favicon.ico" }],
}),
new CopyPlugin({
patterns: [{ from: "./node_modules/@dannadori/voice-changer-js/dist/ort-wasm-simd.wasm", to: "ort-wasm-simd.wasm" }],
}),
new CopyPlugin({
patterns: [{ from: "./node_modules/@dannadori/voice-changer-js/dist/process.js", to: "process.js" }],
}),
new CopyPlugin({
patterns: [{ from: "public/models/emb_pit_24000.bin", to: "models/emb_pit_24000.bin" }],
}),
new CopyPlugin({
patterns: [{ from: "public/models/rvc2v_24000.bin", to: "models/rvc2v_24000.bin" }],
}),
],
};

View File

@ -493,7 +493,7 @@ export type ClientSetting = {
};
export const DefaultClientSettng: ClientSetting = {
workletSetting: {
numTrancateTreshold: 100,
numTrancateTreshold: 512 * 2,
volTrancateThreshold: 0.0005,
volTrancateLength: 32,
},

View File

@ -8,8 +8,8 @@ export type UseWorkletSettingProps = {
};
export type WorkletSettingState = {
// setting: WorkletSetting;
// setSetting: (setting: WorkletSetting) => void;
setting: WorkletSetting;
_setSetting: (setting: WorkletSetting) => void;
};
export const useWorkletSetting = (props: UseWorkletSettingProps): WorkletSettingState => {
@ -29,7 +29,7 @@ export const useWorkletSetting = (props: UseWorkletSettingProps): WorkletSetting
// }, [props.voiceChangerClient])
return {
// setting,
// setSetting,
setting,
_setSetting,
};
};

View File

@ -34,7 +34,7 @@ class VoiceChangerWorkletProcessor extends AudioWorkletProcessor {
private BLOCK_SIZE = 128;
private initialized = false;
private volume = 0;
private numTrancateTreshold = 150;
private numTrancateTreshold = 100;
// private volTrancateThreshold = 0.0005
// private volTrancateLength = 32
// private volTrancateCount = 0
@ -102,6 +102,7 @@ class VoiceChangerWorkletProcessor extends AudioWorkletProcessor {
}
if (this.playBuffer.length > this.numTrancateTreshold) {
console.log(`[worklet] Truncate ${this.playBuffer.length} > ${this.numTrancateTreshold}`);
this.trancateBuffer();
}

View File

@ -163,7 +163,8 @@ class RVCModelSlotGenerator(ModelSlotGenerator):
slot.version = "v2"
elif metadata["version"] == "2.1": # 2.1はclipをonnx内部で実施. realtimeをdisable
slot.version = "v2.1"
elif metadata["version"] == "2.2": # 2.1と同じ
slot.version = "v2.2"
except Exception as e:
slot.modelType = EnumInferenceTypes.onnxRVC.value
slot.embChannels = 256

View File

@ -69,7 +69,7 @@ class OnnxRVCInferencer(Inferencer):
},
)
if self.inferencerTypeVersion == "v2.1" or self.inferencerTypeVersion == "v1.1":
if self.inferencerTypeVersion == "v2.1" or self.inferencerTypeVersion == "v2.2" or self.inferencerTypeVersion == "v1.1":
res = audio1[0]
else:
res = np.array(audio1)[0][0, 0]