mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
WIP:server device and DDSP-SVC
This commit is contained in:
parent
1d91356268
commit
5a72d0a8cd
@ -86,10 +86,6 @@
|
|||||||
{
|
{
|
||||||
"name": "audioOutput",
|
"name": "audioOutput",
|
||||||
"options": {}
|
"options": {}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ioBuffer",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qualityControl": [
|
"qualityControl": [
|
||||||
|
@ -70,10 +70,6 @@
|
|||||||
{
|
{
|
||||||
"name": "audioOutput",
|
"name": "audioOutput",
|
||||||
"options": {}
|
"options": {}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ioBuffer",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qualityControl": [
|
"qualityControl": [
|
||||||
|
@ -74,10 +74,6 @@
|
|||||||
{
|
{
|
||||||
"name": "audioOutput",
|
"name": "audioOutput",
|
||||||
"options": {}
|
"options": {}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ioBuffer",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qualityControl": [
|
"qualityControl": [
|
||||||
|
@ -99,10 +99,6 @@
|
|||||||
{
|
{
|
||||||
"name": "audioOutput",
|
"name": "audioOutput",
|
||||||
"options": {}
|
"options": {}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ioBuffer",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qualityControl": [
|
"qualityControl": [
|
||||||
|
11
client/demo/dist/index.html
vendored
11
client/demo/dist/index.html
vendored
@ -1,10 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!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>
|
||||||
<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>
|
|
1662
client/demo/dist/index.js
vendored
1662
client/demo/dist/index.js
vendored
File diff suppressed because one or more lines are too long
31
client/demo/dist/index.js.LICENSE.txt
vendored
Normal file
31
client/demo/dist/index.js.LICENSE.txt
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @license React
|
||||||
|
* react-dom.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @license React
|
||||||
|
* react.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @license React
|
||||||
|
* scheduler.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
85
client/demo/package-lock.json
generated
85
client/demo/package-lock.json
generated
@ -9,7 +9,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dannadori/voice-changer-client-js": "^1.0.123",
|
"@dannadori/voice-changer-client-js": "^1.0.124",
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|
||||||
"@fortawesome/free-brands-svg-icons": "^6.4.0",
|
"@fortawesome/free-brands-svg-icons": "^6.4.0",
|
||||||
"@fortawesome/free-regular-svg-icons": "^6.4.0",
|
"@fortawesome/free-regular-svg-icons": "^6.4.0",
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"@babel/preset-env": "^7.21.5",
|
"@babel/preset-env": "^7.21.5",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.21.5",
|
"@babel/preset-typescript": "^7.21.5",
|
||||||
"@types/node": "^20.1.0",
|
"@types/node": "^20.1.1",
|
||||||
"@types/react": "^18.2.6",
|
"@types/react": "^18.2.6",
|
||||||
"@types/react-dom": "^18.2.4",
|
"@types/react-dom": "^18.2.4",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
@ -47,8 +47,8 @@
|
|||||||
"tsconfig-paths": "^4.2.0",
|
"tsconfig-paths": "^4.2.0",
|
||||||
"typescript": "^5.0.4",
|
"typescript": "^5.0.4",
|
||||||
"webpack": "^5.82.0",
|
"webpack": "^5.82.0",
|
||||||
"webpack-cli": "^5.0.2",
|
"webpack-cli": "^5.1.1",
|
||||||
"webpack-dev-server": "^4.13.3"
|
"webpack-dev-server": "^4.15.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ampproject/remapping": {
|
"node_modules/@ampproject/remapping": {
|
||||||
@ -3105,9 +3105,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@dannadori/voice-changer-client-js": {
|
"node_modules/@dannadori/voice-changer-client-js": {
|
||||||
"version": "1.0.123",
|
"version": "1.0.124",
|
||||||
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.123.tgz",
|
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.124.tgz",
|
||||||
"integrity": "sha512-upP8HR4//lmPdan7mwE0vogbZjf9a05bc/HJnO2OTXFPpQh1tB+WOeRQU95i2DcKNnWJrNqUTtdvwaEqf40UNw==",
|
"integrity": "sha512-Y5QUGGYC0i7g9XTUUTCeE4K+tB6VxY3ZTC8uMWPjPB4FvMFuKhPCljQiaWlhA2uxapakJ5HjKMkq0vfeAMTy1w==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/readable-stream": "^2.3.15",
|
"@types/readable-stream": "^2.3.15",
|
||||||
"amazon-chime-sdk-js": "^3.14.0",
|
"amazon-chime-sdk-js": "^3.14.0",
|
||||||
@ -3673,9 +3673,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.1.0",
|
"version": "20.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.1.tgz",
|
||||||
"integrity": "sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A=="
|
"integrity": "sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/prop-types": {
|
"node_modules/@types/prop-types": {
|
||||||
"version": "15.7.5",
|
"version": "15.7.5",
|
||||||
@ -3928,9 +3928,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@webpack-cli/configtest": {
|
"node_modules/@webpack-cli/configtest": {
|
||||||
"version": "2.0.1",
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-K/vuv72vpfSEZoo5KIU0a2FsEoYdW0DUMtMpB5X3LlUwshetMZRZRxB7sCsVji/lFaSxtQQ3aM9O4eMolXkU9w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.15.0"
|
"node": ">=14.15.0"
|
||||||
},
|
},
|
||||||
@ -3952,9 +3953,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@webpack-cli/serve": {
|
"node_modules/@webpack-cli/serve": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.4.tgz",
|
||||||
"integrity": "sha512-S9h3GmOmzUseyeFW3tYNnWS7gNUuwxZ3mmMq0JyW78Vx1SGKPSkt5bT4pB0rUnVfHjP0EL9gW2bOzmtiTfQt0A==",
|
"integrity": "sha512-0xRgjgDLdz6G7+vvDLlaRpFatJaJ69uTalZLRSMX5B3VUrDmXcrVA3+6fXXQgmYz7bY9AAgs348XQdmtLsK41A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.15.0"
|
"node": ">=14.15.0"
|
||||||
@ -10056,15 +10057,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/webpack-cli": {
|
"node_modules/webpack-cli": {
|
||||||
"version": "5.0.2",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.1.tgz",
|
||||||
"integrity": "sha512-4y3W5Dawri5+8dXm3+diW6Mn1Ya+Dei6eEVAdIduAmYNLzv1koKVAqsfgrrc9P2mhrYHQphx5htnGkcNwtubyQ==",
|
"integrity": "sha512-OLJwVMoXnXYH2ncNGU8gxVpUtm3ybvdioiTvHgUyBuyMLKiVvWy+QObzBsMtp5pH7qQoEuWgeEUQ/sU3ZJFzAw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discoveryjs/json-ext": "^0.5.0",
|
"@discoveryjs/json-ext": "^0.5.0",
|
||||||
"@webpack-cli/configtest": "^2.0.1",
|
"@webpack-cli/configtest": "^2.1.0",
|
||||||
"@webpack-cli/info": "^2.0.1",
|
"@webpack-cli/info": "^2.0.1",
|
||||||
"@webpack-cli/serve": "^2.0.2",
|
"@webpack-cli/serve": "^2.0.4",
|
||||||
"colorette": "^2.0.14",
|
"colorette": "^2.0.14",
|
||||||
"commander": "^10.0.1",
|
"commander": "^10.0.1",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
@ -10132,9 +10133,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/webpack-dev-server": {
|
"node_modules/webpack-dev-server": {
|
||||||
"version": "4.13.3",
|
"version": "4.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.13.3.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.0.tgz",
|
||||||
"integrity": "sha512-KqqzrzMRSRy5ePz10VhjyL27K2dxqwXQLP5rAKwRJBPUahe7Z2bBWzHw37jeb8GCPKxZRO79ZdQUAPesMh/Nug==",
|
"integrity": "sha512-HmNB5QeSl1KpulTBQ8UT4FPrByYyaLxpJoQ0+s7EvUrMc16m0ZS1sgb1XGqzmgCPk0c9y+aaXxn11tbLzuM7NQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/bonjour": "^3.5.9",
|
"@types/bonjour": "^3.5.9",
|
||||||
@ -12813,9 +12814,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@dannadori/voice-changer-client-js": {
|
"@dannadori/voice-changer-client-js": {
|
||||||
"version": "1.0.123",
|
"version": "1.0.124",
|
||||||
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.123.tgz",
|
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.124.tgz",
|
||||||
"integrity": "sha512-upP8HR4//lmPdan7mwE0vogbZjf9a05bc/HJnO2OTXFPpQh1tB+WOeRQU95i2DcKNnWJrNqUTtdvwaEqf40UNw==",
|
"integrity": "sha512-Y5QUGGYC0i7g9XTUUTCeE4K+tB6VxY3ZTC8uMWPjPB4FvMFuKhPCljQiaWlhA2uxapakJ5HjKMkq0vfeAMTy1w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/readable-stream": "^2.3.15",
|
"@types/readable-stream": "^2.3.15",
|
||||||
"amazon-chime-sdk-js": "^3.14.0",
|
"amazon-chime-sdk-js": "^3.14.0",
|
||||||
@ -13230,9 +13231,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "20.1.0",
|
"version": "20.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.1.tgz",
|
||||||
"integrity": "sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A=="
|
"integrity": "sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A=="
|
||||||
},
|
},
|
||||||
"@types/prop-types": {
|
"@types/prop-types": {
|
||||||
"version": "15.7.5",
|
"version": "15.7.5",
|
||||||
@ -13473,7 +13474,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@webpack-cli/configtest": {
|
"@webpack-cli/configtest": {
|
||||||
"version": "2.0.1",
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-K/vuv72vpfSEZoo5KIU0a2FsEoYdW0DUMtMpB5X3LlUwshetMZRZRxB7sCsVji/lFaSxtQQ3aM9O4eMolXkU9w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
@ -13483,9 +13486,9 @@
|
|||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"@webpack-cli/serve": {
|
"@webpack-cli/serve": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.4.tgz",
|
||||||
"integrity": "sha512-S9h3GmOmzUseyeFW3tYNnWS7gNUuwxZ3mmMq0JyW78Vx1SGKPSkt5bT4pB0rUnVfHjP0EL9gW2bOzmtiTfQt0A==",
|
"integrity": "sha512-0xRgjgDLdz6G7+vvDLlaRpFatJaJ69uTalZLRSMX5B3VUrDmXcrVA3+6fXXQgmYz7bY9AAgs348XQdmtLsK41A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
@ -17324,15 +17327,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"webpack-cli": {
|
"webpack-cli": {
|
||||||
"version": "5.0.2",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.1.tgz",
|
||||||
"integrity": "sha512-4y3W5Dawri5+8dXm3+diW6Mn1Ya+Dei6eEVAdIduAmYNLzv1koKVAqsfgrrc9P2mhrYHQphx5htnGkcNwtubyQ==",
|
"integrity": "sha512-OLJwVMoXnXYH2ncNGU8gxVpUtm3ybvdioiTvHgUyBuyMLKiVvWy+QObzBsMtp5pH7qQoEuWgeEUQ/sU3ZJFzAw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@discoveryjs/json-ext": "^0.5.0",
|
"@discoveryjs/json-ext": "^0.5.0",
|
||||||
"@webpack-cli/configtest": "^2.0.1",
|
"@webpack-cli/configtest": "^2.1.0",
|
||||||
"@webpack-cli/info": "^2.0.1",
|
"@webpack-cli/info": "^2.0.1",
|
||||||
"@webpack-cli/serve": "^2.0.2",
|
"@webpack-cli/serve": "^2.0.4",
|
||||||
"colorette": "^2.0.14",
|
"colorette": "^2.0.14",
|
||||||
"commander": "^10.0.1",
|
"commander": "^10.0.1",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
@ -17364,9 +17367,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"webpack-dev-server": {
|
"webpack-dev-server": {
|
||||||
"version": "4.13.3",
|
"version": "4.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.13.3.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.0.tgz",
|
||||||
"integrity": "sha512-KqqzrzMRSRy5ePz10VhjyL27K2dxqwXQLP5rAKwRJBPUahe7Z2bBWzHw37jeb8GCPKxZRO79ZdQUAPesMh/Nug==",
|
"integrity": "sha512-HmNB5QeSl1KpulTBQ8UT4FPrByYyaLxpJoQ0+s7EvUrMc16m0ZS1sgb1XGqzmgCPk0c9y+aaXxn11tbLzuM7NQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/bonjour": "^3.5.9",
|
"@types/bonjour": "^3.5.9",
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
"@babel/preset-env": "^7.21.5",
|
"@babel/preset-env": "^7.21.5",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.18.6",
|
||||||
"@babel/preset-typescript": "^7.21.5",
|
"@babel/preset-typescript": "^7.21.5",
|
||||||
"@types/node": "^20.1.0",
|
"@types/node": "^20.1.1",
|
||||||
"@types/react": "^18.2.6",
|
"@types/react": "^18.2.6",
|
||||||
"@types/react-dom": "^18.2.4",
|
"@types/react-dom": "^18.2.4",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
@ -47,11 +47,11 @@
|
|||||||
"tsconfig-paths": "^4.2.0",
|
"tsconfig-paths": "^4.2.0",
|
||||||
"typescript": "^5.0.4",
|
"typescript": "^5.0.4",
|
||||||
"webpack": "^5.82.0",
|
"webpack": "^5.82.0",
|
||||||
"webpack-cli": "^5.0.2",
|
"webpack-cli": "^5.1.1",
|
||||||
"webpack-dev-server": "^4.13.3"
|
"webpack-dev-server": "^4.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dannadori/voice-changer-client-js": "^1.0.123",
|
"@dannadori/voice-changer-client-js": "^1.0.124",
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|
"@fortawesome/fontawesome-svg-core": "^6.4.0",
|
||||||
"@fortawesome/free-brands-svg-icons": "^6.4.0",
|
"@fortawesome/free-brands-svg-icons": "^6.4.0",
|
||||||
"@fortawesome/free-regular-svg-icons": "^6.4.0",
|
"@fortawesome/free-regular-svg-icons": "^6.4.0",
|
||||||
|
@ -86,10 +86,6 @@
|
|||||||
{
|
{
|
||||||
"name": "audioOutput",
|
"name": "audioOutput",
|
||||||
"options": {}
|
"options": {}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ioBuffer",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qualityControl": [
|
"qualityControl": [
|
||||||
|
@ -70,10 +70,6 @@
|
|||||||
{
|
{
|
||||||
"name": "audioOutput",
|
"name": "audioOutput",
|
||||||
"options": {}
|
"options": {}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ioBuffer",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qualityControl": [
|
"qualityControl": [
|
||||||
|
@ -74,10 +74,6 @@
|
|||||||
{
|
{
|
||||||
"name": "audioOutput",
|
"name": "audioOutput",
|
||||||
"options": {}
|
"options": {}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ioBuffer",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qualityControl": [
|
"qualityControl": [
|
||||||
|
@ -99,10 +99,6 @@
|
|||||||
{
|
{
|
||||||
"name": "audioOutput",
|
"name": "audioOutput",
|
||||||
"options": {}
|
"options": {}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ioBuffer",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"qualityControl": [
|
"qualityControl": [
|
||||||
|
78
client/lib/package-lock.json
generated
78
client/lib/package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@dannadori/voice-changer-client-js",
|
"name": "@dannadori/voice-changer-client-js",
|
||||||
"version": "1.0.123",
|
"version": "1.0.124",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@dannadori/voice-changer-client-js",
|
"name": "@dannadori/voice-changer-client-js",
|
||||||
"version": "1.0.123",
|
"version": "1.0.124",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/readable-stream": "^2.3.15",
|
"@types/readable-stream": "^2.3.15",
|
||||||
@ -19,7 +19,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/audioworklet": "^0.0.45",
|
"@types/audioworklet": "^0.0.45",
|
||||||
"@types/node": "^20.1.0",
|
"@types/node": "^20.1.1",
|
||||||
"@types/react": "18.2.6",
|
"@types/react": "18.2.6",
|
||||||
"@types/react-dom": "18.2.4",
|
"@types/react-dom": "18.2.4",
|
||||||
"eslint": "^8.40.0",
|
"eslint": "^8.40.0",
|
||||||
@ -34,8 +34,8 @@
|
|||||||
"ts-loader": "^9.4.2",
|
"ts-loader": "^9.4.2",
|
||||||
"typescript": "^5.0.4",
|
"typescript": "^5.0.4",
|
||||||
"webpack": "^5.82.0",
|
"webpack": "^5.82.0",
|
||||||
"webpack-cli": "^5.0.2",
|
"webpack-cli": "^5.1.1",
|
||||||
"webpack-dev-server": "^4.13.3"
|
"webpack-dev-server": "^4.15.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aws-crypto/ie11-detection": {
|
"node_modules/@aws-crypto/ie11-detection": {
|
||||||
@ -1829,9 +1829,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.1.0",
|
"version": "20.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.1.tgz",
|
||||||
"integrity": "sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A=="
|
"integrity": "sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/prop-types": {
|
"node_modules/@types/prop-types": {
|
||||||
"version": "15.7.5",
|
"version": "15.7.5",
|
||||||
@ -2096,9 +2096,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@webpack-cli/configtest": {
|
"node_modules/@webpack-cli/configtest": {
|
||||||
"version": "2.0.1",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.0.tgz",
|
||||||
"integrity": "sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A==",
|
"integrity": "sha512-K/vuv72vpfSEZoo5KIU0a2FsEoYdW0DUMtMpB5X3LlUwshetMZRZRxB7sCsVji/lFaSxtQQ3aM9O4eMolXkU9w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.15.0"
|
"node": ">=14.15.0"
|
||||||
@ -2122,9 +2122,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@webpack-cli/serve": {
|
"node_modules/@webpack-cli/serve": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.4.tgz",
|
||||||
"integrity": "sha512-S9h3GmOmzUseyeFW3tYNnWS7gNUuwxZ3mmMq0JyW78Vx1SGKPSkt5bT4pB0rUnVfHjP0EL9gW2bOzmtiTfQt0A==",
|
"integrity": "sha512-0xRgjgDLdz6G7+vvDLlaRpFatJaJ69uTalZLRSMX5B3VUrDmXcrVA3+6fXXQgmYz7bY9AAgs348XQdmtLsK41A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.15.0"
|
"node": ">=14.15.0"
|
||||||
@ -7396,15 +7396,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/webpack-cli": {
|
"node_modules/webpack-cli": {
|
||||||
"version": "5.0.2",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.1.tgz",
|
||||||
"integrity": "sha512-4y3W5Dawri5+8dXm3+diW6Mn1Ya+Dei6eEVAdIduAmYNLzv1koKVAqsfgrrc9P2mhrYHQphx5htnGkcNwtubyQ==",
|
"integrity": "sha512-OLJwVMoXnXYH2ncNGU8gxVpUtm3ybvdioiTvHgUyBuyMLKiVvWy+QObzBsMtp5pH7qQoEuWgeEUQ/sU3ZJFzAw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discoveryjs/json-ext": "^0.5.0",
|
"@discoveryjs/json-ext": "^0.5.0",
|
||||||
"@webpack-cli/configtest": "^2.0.1",
|
"@webpack-cli/configtest": "^2.1.0",
|
||||||
"@webpack-cli/info": "^2.0.1",
|
"@webpack-cli/info": "^2.0.1",
|
||||||
"@webpack-cli/serve": "^2.0.2",
|
"@webpack-cli/serve": "^2.0.4",
|
||||||
"colorette": "^2.0.14",
|
"colorette": "^2.0.14",
|
||||||
"commander": "^10.0.1",
|
"commander": "^10.0.1",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
@ -7473,9 +7473,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/webpack-dev-server": {
|
"node_modules/webpack-dev-server": {
|
||||||
"version": "4.13.3",
|
"version": "4.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.13.3.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.0.tgz",
|
||||||
"integrity": "sha512-KqqzrzMRSRy5ePz10VhjyL27K2dxqwXQLP5rAKwRJBPUahe7Z2bBWzHw37jeb8GCPKxZRO79ZdQUAPesMh/Nug==",
|
"integrity": "sha512-HmNB5QeSl1KpulTBQ8UT4FPrByYyaLxpJoQ0+s7EvUrMc16m0ZS1sgb1XGqzmgCPk0c9y+aaXxn11tbLzuM7NQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/bonjour": "^3.5.9",
|
"@types/bonjour": "^3.5.9",
|
||||||
@ -9476,9 +9476,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "20.1.0",
|
"version": "20.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.1.tgz",
|
||||||
"integrity": "sha512-O+z53uwx64xY7D6roOi4+jApDGFg0qn6WHcxe5QeqjMaTezBO/mxdfFXIVAVVyNWKx84OmPB3L8kbVYOTeN34A=="
|
"integrity": "sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A=="
|
||||||
},
|
},
|
||||||
"@types/prop-types": {
|
"@types/prop-types": {
|
||||||
"version": "15.7.5",
|
"version": "15.7.5",
|
||||||
@ -9743,9 +9743,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@webpack-cli/configtest": {
|
"@webpack-cli/configtest": {
|
||||||
"version": "2.0.1",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.0.tgz",
|
||||||
"integrity": "sha512-njsdJXJSiS2iNbQVS0eT8A/KPnmyH4pv1APj2K0d1wrZcBLw+yppxOy4CGqa0OxDJkzfL/XELDhD8rocnIwB5A==",
|
"integrity": "sha512-K/vuv72vpfSEZoo5KIU0a2FsEoYdW0DUMtMpB5X3LlUwshetMZRZRxB7sCsVji/lFaSxtQQ3aM9O4eMolXkU9w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
@ -9757,9 +9757,9 @@
|
|||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"@webpack-cli/serve": {
|
"@webpack-cli/serve": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.4.tgz",
|
||||||
"integrity": "sha512-S9h3GmOmzUseyeFW3tYNnWS7gNUuwxZ3mmMq0JyW78Vx1SGKPSkt5bT4pB0rUnVfHjP0EL9gW2bOzmtiTfQt0A==",
|
"integrity": "sha512-0xRgjgDLdz6G7+vvDLlaRpFatJaJ69uTalZLRSMX5B3VUrDmXcrVA3+6fXXQgmYz7bY9AAgs348XQdmtLsK41A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
@ -13650,15 +13650,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"webpack-cli": {
|
"webpack-cli": {
|
||||||
"version": "5.0.2",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.1.tgz",
|
||||||
"integrity": "sha512-4y3W5Dawri5+8dXm3+diW6Mn1Ya+Dei6eEVAdIduAmYNLzv1koKVAqsfgrrc9P2mhrYHQphx5htnGkcNwtubyQ==",
|
"integrity": "sha512-OLJwVMoXnXYH2ncNGU8gxVpUtm3ybvdioiTvHgUyBuyMLKiVvWy+QObzBsMtp5pH7qQoEuWgeEUQ/sU3ZJFzAw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@discoveryjs/json-ext": "^0.5.0",
|
"@discoveryjs/json-ext": "^0.5.0",
|
||||||
"@webpack-cli/configtest": "^2.0.1",
|
"@webpack-cli/configtest": "^2.1.0",
|
||||||
"@webpack-cli/info": "^2.0.1",
|
"@webpack-cli/info": "^2.0.1",
|
||||||
"@webpack-cli/serve": "^2.0.2",
|
"@webpack-cli/serve": "^2.0.4",
|
||||||
"colorette": "^2.0.14",
|
"colorette": "^2.0.14",
|
||||||
"commander": "^10.0.1",
|
"commander": "^10.0.1",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
@ -13692,9 +13692,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"webpack-dev-server": {
|
"webpack-dev-server": {
|
||||||
"version": "4.13.3",
|
"version": "4.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.13.3.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.0.tgz",
|
||||||
"integrity": "sha512-KqqzrzMRSRy5ePz10VhjyL27K2dxqwXQLP5rAKwRJBPUahe7Z2bBWzHw37jeb8GCPKxZRO79ZdQUAPesMh/Nug==",
|
"integrity": "sha512-HmNB5QeSl1KpulTBQ8UT4FPrByYyaLxpJoQ0+s7EvUrMc16m0ZS1sgb1XGqzmgCPk0c9y+aaXxn11tbLzuM7NQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/bonjour": "^3.5.9",
|
"@types/bonjour": "^3.5.9",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@dannadori/voice-changer-client-js",
|
"name": "@dannadori/voice-changer-client-js",
|
||||||
"version": "1.0.123",
|
"version": "1.0.124",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
@ -27,7 +27,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/audioworklet": "^0.0.45",
|
"@types/audioworklet": "^0.0.45",
|
||||||
"@types/node": "^20.1.0",
|
"@types/node": "^20.1.1",
|
||||||
"@types/react": "18.2.6",
|
"@types/react": "18.2.6",
|
||||||
"@types/react-dom": "18.2.4",
|
"@types/react-dom": "18.2.4",
|
||||||
"eslint": "^8.40.0",
|
"eslint": "^8.40.0",
|
||||||
@ -42,8 +42,8 @@
|
|||||||
"ts-loader": "^9.4.2",
|
"ts-loader": "^9.4.2",
|
||||||
"typescript": "^5.0.4",
|
"typescript": "^5.0.4",
|
||||||
"webpack": "^5.82.0",
|
"webpack": "^5.82.0",
|
||||||
"webpack-cli": "^5.0.2",
|
"webpack-cli": "^5.1.1",
|
||||||
"webpack-dev-server": "^4.13.3"
|
"webpack-dev-server": "^4.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/readable-stream": "^2.3.15",
|
"@types/readable-stream": "^2.3.15",
|
||||||
|
@ -24,10 +24,10 @@ from Exceptions import (
|
|||||||
ONNXInputArgumentException,
|
ONNXInputArgumentException,
|
||||||
)
|
)
|
||||||
from voice_changer.utils.VoiceChangerParams import VoiceChangerParams
|
from voice_changer.utils.VoiceChangerParams import VoiceChangerParams
|
||||||
import pyaudio
|
|
||||||
import threading
|
import threading
|
||||||
import struct
|
|
||||||
import time
|
import time
|
||||||
|
import sounddevice as sd
|
||||||
|
import librosa
|
||||||
|
|
||||||
providers = [
|
providers = [
|
||||||
"OpenVINOExecutionProvider",
|
"OpenVINOExecutionProvider",
|
||||||
@ -56,8 +56,10 @@ class VoiceChangerSettings:
|
|||||||
|
|
||||||
enableServerAudio: int = 0 # 0:off, 1:on
|
enableServerAudio: int = 0 # 0:off, 1:on
|
||||||
serverAudioStated: int = 0 # 0:off, 1:on
|
serverAudioStated: int = 0 # 0:off, 1:on
|
||||||
serverInputAudioSampleRate: int = 48000
|
# serverInputAudioSampleRate: int = 48000
|
||||||
serverOutputAudioSampleRate: int = 48000
|
# serverOutputAudioSampleRate: int = 48000
|
||||||
|
serverInputAudioSampleRate: int = 44100
|
||||||
|
serverOutputAudioSampleRate: int = 44100
|
||||||
serverInputAudioBufferSize: int = 1024 * 24
|
serverInputAudioBufferSize: int = 1024 * 24
|
||||||
serverOutputAudioBufferSize: int = 1024 * 24
|
serverOutputAudioBufferSize: int = 1024 * 24
|
||||||
serverInputDeviceId: int = -1
|
serverInputDeviceId: int = -1
|
||||||
@ -88,104 +90,6 @@ class VoiceChangerSettings:
|
|||||||
strData: list[str] = field(default_factory=lambda: [])
|
strData: list[str] = field(default_factory=lambda: [])
|
||||||
|
|
||||||
|
|
||||||
def serverLocal(_vc):
|
|
||||||
vc: VoiceChanger = _vc
|
|
||||||
audio = pyaudio.PyAudio()
|
|
||||||
|
|
||||||
def createAudioInput(deviceId: int, sampleRate: int, bufferSize: int):
|
|
||||||
audio_input_stream = audio.open(
|
|
||||||
format=pyaudio.paInt16,
|
|
||||||
channels=1,
|
|
||||||
rate=sampleRate,
|
|
||||||
# frames_per_buffer=32768,
|
|
||||||
frames_per_buffer=bufferSize,
|
|
||||||
input_device_index=deviceId,
|
|
||||||
input=True,
|
|
||||||
)
|
|
||||||
return audio_input_stream
|
|
||||||
|
|
||||||
def createAudioOutput(deviceId: int, sampleRate: int, bufferSize: int):
|
|
||||||
audio_output_stream = audio.open(
|
|
||||||
format=pyaudio.paInt16,
|
|
||||||
channels=1,
|
|
||||||
rate=sampleRate,
|
|
||||||
# frames_per_buffer=32768,
|
|
||||||
frames_per_buffer=bufferSize,
|
|
||||||
output_device_index=deviceId,
|
|
||||||
output=True,
|
|
||||||
)
|
|
||||||
return audio_output_stream
|
|
||||||
|
|
||||||
currentInputDeviceId = -1
|
|
||||||
currentInputSampleRate = -1
|
|
||||||
currentInputBufferSize = -1
|
|
||||||
currentOutputDeviceId = -1
|
|
||||||
currentOutputSampleRate = -1
|
|
||||||
currentOutputBufferSize = -1
|
|
||||||
|
|
||||||
audio_input_stream = None
|
|
||||||
audio_output_stream = None
|
|
||||||
showPerformanceTime = 0
|
|
||||||
while True:
|
|
||||||
if (
|
|
||||||
vc.settings.enableServerAudio == 0
|
|
||||||
or vc.settings.serverAudioStated == 0
|
|
||||||
or vc.settings.serverInputDeviceId == -1
|
|
||||||
or vc.settings.serverOutputDeviceId == -1
|
|
||||||
):
|
|
||||||
time.sleep(2)
|
|
||||||
else:
|
|
||||||
if (
|
|
||||||
currentInputDeviceId != vc.settings.serverInputDeviceId
|
|
||||||
or currentInputSampleRate != vc.settings.serverInputAudioSampleRate
|
|
||||||
or currentInputBufferSize != vc.settings.serverInputAudioBufferSize
|
|
||||||
):
|
|
||||||
currentInputDeviceId = vc.settings.serverInputDeviceId
|
|
||||||
currentInputSampleRate = vc.settings.serverInputAudioSampleRate
|
|
||||||
currentInputBufferSize = vc.settings.serverInputAudioBufferSize
|
|
||||||
if audio_input_stream is not None:
|
|
||||||
audio_input_stream.close()
|
|
||||||
audio_input_stream = createAudioInput(
|
|
||||||
currentInputDeviceId,
|
|
||||||
currentInputSampleRate,
|
|
||||||
currentInputBufferSize,
|
|
||||||
)
|
|
||||||
|
|
||||||
if (
|
|
||||||
currentOutputDeviceId != vc.settings.serverOutputDeviceId
|
|
||||||
or currentOutputSampleRate != vc.settings.serverOutputAudioSampleRate
|
|
||||||
or currentOutputBufferSize != vc.settings.serverOutputAudioBufferSize
|
|
||||||
):
|
|
||||||
currentOutputDeviceId = vc.settings.serverOutputDeviceId
|
|
||||||
currentOutputSampleRate = vc.settings.serverOutputAudioSampleRate
|
|
||||||
currentOutputBufferSize = vc.settings.serverOutputAudioBufferSize
|
|
||||||
if audio_output_stream is not None:
|
|
||||||
audio_output_stream.close()
|
|
||||||
audio_output_stream = createAudioOutput(
|
|
||||||
currentOutputDeviceId,
|
|
||||||
currentOutputSampleRate,
|
|
||||||
currentOutputBufferSize,
|
|
||||||
)
|
|
||||||
sampleNum = vc.settings.serverReadChunkSize * 128
|
|
||||||
in_wav = audio_input_stream.read(sampleNum, exception_on_overflow=False)
|
|
||||||
readNum = len(in_wav) // struct.calcsize("<h")
|
|
||||||
unpackedData = np.array(struct.unpack("<%sh" % readNum, in_wav)).astype(
|
|
||||||
np.int16
|
|
||||||
)
|
|
||||||
with Timer("all_inference_time") as t:
|
|
||||||
out_wav, times = vc.on_request(unpackedData)
|
|
||||||
all_inference_time = t.secs
|
|
||||||
performance = [all_inference_time] + times
|
|
||||||
performance = [round(x * 1000) for x in performance]
|
|
||||||
vc.settings.performance = performance
|
|
||||||
currentTime = time.time()
|
|
||||||
if currentTime - showPerformanceTime > 5:
|
|
||||||
print(sampleNum, readNum, performance)
|
|
||||||
showPerformanceTime = currentTime
|
|
||||||
|
|
||||||
audio_output_stream.write(out_wav.tobytes())
|
|
||||||
|
|
||||||
|
|
||||||
class VoiceChanger:
|
class VoiceChanger:
|
||||||
settings: VoiceChangerSettings
|
settings: VoiceChangerSettings
|
||||||
voiceChanger: VoiceChangerModel
|
voiceChanger: VoiceChangerModel
|
||||||
@ -193,6 +97,88 @@ class VoiceChanger:
|
|||||||
sola_buffer: AudioInOut
|
sola_buffer: AudioInOut
|
||||||
namespace: socketio.AsyncNamespace | None = None
|
namespace: socketio.AsyncNamespace | None = None
|
||||||
|
|
||||||
|
def audio_callback(
|
||||||
|
self, indata: np.ndarray, outdata: np.ndarray, frames, times, status
|
||||||
|
):
|
||||||
|
# print(indata)
|
||||||
|
try:
|
||||||
|
with Timer("all_inference_time") as t:
|
||||||
|
unpackedData = librosa.to_mono(indata.T) * 32768.0
|
||||||
|
out_wav, times = self.on_request(unpackedData)
|
||||||
|
outdata[:] = np.repeat(out_wav, 2).reshape(-1, 2) / 32768.0
|
||||||
|
all_inference_time = t.secs
|
||||||
|
performance = [all_inference_time] + times
|
||||||
|
performance = [round(x * 1000) for x in performance]
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
def serverLocal(self, _vc):
|
||||||
|
vc: VoiceChanger = _vc
|
||||||
|
|
||||||
|
currentInputDeviceId = -1
|
||||||
|
currentInputSampleRate = -1
|
||||||
|
currentOutputDeviceId = -1
|
||||||
|
currentInputChunkNum = -1
|
||||||
|
while True:
|
||||||
|
if (
|
||||||
|
vc.settings.serverAudioStated == 0
|
||||||
|
or vc.settings.serverInputDeviceId == -1
|
||||||
|
):
|
||||||
|
vc.settings.inputSampleRate = 48000
|
||||||
|
time.sleep(2)
|
||||||
|
else:
|
||||||
|
sd._terminate()
|
||||||
|
sd._initialize()
|
||||||
|
if currentInputDeviceId != vc.settings.serverInputDeviceId:
|
||||||
|
sd.default.device[0] = vc.settings.serverInputDeviceId
|
||||||
|
currentInputDeviceId = vc.settings.serverInputDeviceId
|
||||||
|
if currentOutputDeviceId != vc.settings.serverOutputDeviceId:
|
||||||
|
sd.default.device[1] = vc.settings.serverOutputDeviceId
|
||||||
|
currentOutputDeviceId = vc.settings.serverOutputDeviceId
|
||||||
|
|
||||||
|
currentInputSampleRate = vc.settings.serverInputAudioSampleRate
|
||||||
|
currentInputChunkNum = vc.settings.serverReadChunkSize
|
||||||
|
block_frame = currentInputChunkNum * 128
|
||||||
|
try:
|
||||||
|
with sd.Stream(
|
||||||
|
callback=self.audio_callback,
|
||||||
|
blocksize=block_frame,
|
||||||
|
samplerate=currentInputSampleRate,
|
||||||
|
dtype="float32",
|
||||||
|
):
|
||||||
|
while (
|
||||||
|
vc.settings.serverAudioStated == 1
|
||||||
|
and currentInputDeviceId == vc.settings.serverInputDeviceId
|
||||||
|
and currentOutputDeviceId
|
||||||
|
== vc.settings.serverOutputDeviceId
|
||||||
|
and currentInputSampleRate
|
||||||
|
== vc.settings.serverInputAudioSampleRate
|
||||||
|
and currentInputChunkNum == vc.settings.serverReadChunkSize
|
||||||
|
):
|
||||||
|
vc.settings.serverInputAudioSampleRate = (
|
||||||
|
self.voiceChanger.get_processing_sampling_rate()
|
||||||
|
)
|
||||||
|
vc.settings.inputSampleRate = (
|
||||||
|
vc.settings.serverInputAudioSampleRate
|
||||||
|
)
|
||||||
|
time.sleep(2)
|
||||||
|
print(
|
||||||
|
"[Voice Changer] server audio",
|
||||||
|
self.settings.performance,
|
||||||
|
)
|
||||||
|
print(
|
||||||
|
"[Voice Changer] info:",
|
||||||
|
vc.settings.serverAudioStated,
|
||||||
|
currentInputDeviceId,
|
||||||
|
currentOutputDeviceId,
|
||||||
|
currentInputSampleRate,
|
||||||
|
currentInputChunkNum,
|
||||||
|
)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
time.sleep(2)
|
||||||
|
|
||||||
def __init__(self, params: VoiceChangerParams):
|
def __init__(self, params: VoiceChangerParams):
|
||||||
# 初期化
|
# 初期化
|
||||||
self.settings = VoiceChangerSettings()
|
self.settings = VoiceChangerSettings()
|
||||||
@ -216,7 +202,7 @@ class VoiceChanger:
|
|||||||
self.settings.serverAudioInputDevices = audioinput
|
self.settings.serverAudioInputDevices = audioinput
|
||||||
self.settings.serverAudioOutputDevices = audiooutput
|
self.settings.serverAudioOutputDevices = audiooutput
|
||||||
|
|
||||||
thread = threading.Thread(target=serverLocal, args=(self,))
|
thread = threading.Thread(target=self.serverLocal, args=(self,))
|
||||||
thread.start()
|
thread.start()
|
||||||
print(
|
print(
|
||||||
f"VoiceChanger Initialized (GPU_NUM:{self.gpu_num}, mps_enabled:{self.mps_enabled})"
|
f"VoiceChanger Initialized (GPU_NUM:{self.gpu_num}, mps_enabled:{self.mps_enabled})"
|
||||||
@ -452,6 +438,11 @@ class VoiceChanger:
|
|||||||
with Timer("post-process") as t:
|
with Timer("post-process") as t:
|
||||||
result = result.astype(np.int16)
|
result = result.astype(np.int16)
|
||||||
if self.settings.inputSampleRate != processing_sampling_rate:
|
if self.settings.inputSampleRate != processing_sampling_rate:
|
||||||
|
print(
|
||||||
|
"samplingrate",
|
||||||
|
self.settings.inputSampleRate,
|
||||||
|
processing_sampling_rate,
|
||||||
|
)
|
||||||
outputData = cast(
|
outputData = cast(
|
||||||
AudioInOut,
|
AudioInOut,
|
||||||
resampy.resample(
|
resampy.resample(
|
||||||
@ -471,11 +462,13 @@ class VoiceChanger:
|
|||||||
self.ioRecorder.writeInput(receivedData)
|
self.ioRecorder.writeInput(receivedData)
|
||||||
self.ioRecorder.writeOutput(outputData.tobytes())
|
self.ioRecorder.writeOutput(outputData.tobytes())
|
||||||
|
|
||||||
# if receivedData.shape[0] != outputData.shape[0]:
|
if receivedData.shape[0] != outputData.shape[0]:
|
||||||
# print(f"Padding, in:{receivedData.shape[0]} out:{outputData.shape[0]}")
|
print(
|
||||||
# outputData = pad_array(outputData, receivedData.shape[0])
|
f"Padding, in:{receivedData.shape[0]} out:{outputData.shape[0]}"
|
||||||
# # print_convert_processing(
|
)
|
||||||
# # f" Padded!, Output data size of {result.shape[0]}/{processing_sampling_rate}hz {outputData.shape[0]}/{self.settings.inputSampleRate}hz")
|
outputData = pad_array(outputData, receivedData.shape[0])
|
||||||
|
# print_convert_processing(
|
||||||
|
# f" Padded!, Output data size of {result.shape[0]}/{processing_sampling_rate}hz {outputData.shape[0]}/{self.settings.inputSampleRate}hz")
|
||||||
postprocess_time = t.secs
|
postprocess_time = t.secs
|
||||||
|
|
||||||
print_convert_processing(
|
print_convert_processing(
|
||||||
|
Loading…
Reference in New Issue
Block a user