mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
python clinet
This commit is contained in:
parent
3e5ed4dac1
commit
ceb458e2ce
11
client/demo_so-vits-svc_40v2/dist/index.html
vendored
11
client/demo_so-vits-svc_40v2/dist/index.html
vendored
@ -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>
|
||||||
|
914
client/demo_so-vits-svc_40v2/dist/index.js
vendored
914
client/demo_so-vits-svc_40v2/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -1,31 +0,0 @@
|
|||||||
/*! 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.
|
|
||||||
*/
|
|
14
client/demo_so-vits-svc_40v2/package-lock.json
generated
14
client/demo_so-vits-svc_40v2/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.90",
|
"@dannadori/voice-changer-client-js": "^1.0.91",
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.3.0",
|
"@fortawesome/fontawesome-svg-core": "^6.3.0",
|
||||||
"@fortawesome/free-brands-svg-icons": "^6.3.0",
|
"@fortawesome/free-brands-svg-icons": "^6.3.0",
|
||||||
"@fortawesome/free-regular-svg-icons": "^6.3.0",
|
"@fortawesome/free-regular-svg-icons": "^6.3.0",
|
||||||
@ -3187,9 +3187,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@dannadori/voice-changer-client-js": {
|
"node_modules/@dannadori/voice-changer-client-js": {
|
||||||
"version": "1.0.90",
|
"version": "1.0.91",
|
||||||
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.90.tgz",
|
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.91.tgz",
|
||||||
"integrity": "sha512-+OEfe3Izmz43k4OlaM0WNCVglUfSJibLDheplN+Yo1jRdSny6Rc8AusGFOCPKLtRB1JYkCAEagZsfoEfOxUzVQ==",
|
"integrity": "sha512-6LFLHoPDOha7LVQfd6NDkUKn6ihYGvihdZAZG8huk//BQTVeeS2o48XB9fWk1iNyrv2zbj3XTh1GUR/nFFoHBw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/readable-stream": "^2.3.15",
|
"@types/readable-stream": "^2.3.15",
|
||||||
"amazon-chime-sdk-js": "^3.11.0",
|
"amazon-chime-sdk-js": "^3.11.0",
|
||||||
@ -13567,9 +13567,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@dannadori/voice-changer-client-js": {
|
"@dannadori/voice-changer-client-js": {
|
||||||
"version": "1.0.90",
|
"version": "1.0.91",
|
||||||
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.90.tgz",
|
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.91.tgz",
|
||||||
"integrity": "sha512-+OEfe3Izmz43k4OlaM0WNCVglUfSJibLDheplN+Yo1jRdSny6Rc8AusGFOCPKLtRB1JYkCAEagZsfoEfOxUzVQ==",
|
"integrity": "sha512-6LFLHoPDOha7LVQfd6NDkUKn6ihYGvihdZAZG8huk//BQTVeeS2o48XB9fWk1iNyrv2zbj3XTh1GUR/nFFoHBw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/readable-stream": "^2.3.15",
|
"@types/readable-stream": "^2.3.15",
|
||||||
"amazon-chime-sdk-js": "^3.11.0",
|
"amazon-chime-sdk-js": "^3.11.0",
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
"webpack-dev-server": "^4.11.1"
|
"webpack-dev-server": "^4.11.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dannadori/voice-changer-client-js": "^1.0.90",
|
"@dannadori/voice-changer-client-js": "^1.0.91",
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.3.0",
|
"@fortawesome/fontawesome-svg-core": "^6.3.0",
|
||||||
"@fortawesome/free-brands-svg-icons": "^6.3.0",
|
"@fortawesome/free-brands-svg-icons": "^6.3.0",
|
||||||
"@fortawesome/free-regular-svg-icons": "^6.3.0",
|
"@fortawesome/free-regular-svg-icons": "^6.3.0",
|
||||||
|
@ -483,9 +483,6 @@ body {
|
|||||||
margin-left: 1rem;
|
margin-left: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.body-button-container-space-around {
|
|
||||||
justify-content: space-around;
|
|
||||||
}
|
|
||||||
.body-button-container {
|
.body-button-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@ -530,6 +527,11 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.body-button-container-space-around {
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
.body-select {
|
.body-select {
|
||||||
color: rgb(30, 30, 30);
|
color: rgb(30, 30, 30);
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
4
client/lib/package-lock.json
generated
4
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.90",
|
"version": "1.0.91",
|
||||||
"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.90",
|
"version": "1.0.91",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/readable-stream": "^2.3.15",
|
"@types/readable-stream": "^2.3.15",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@dannadori/voice-changer-client-js",
|
"name": "@dannadori/voice-changer-client-js",
|
||||||
"version": "1.0.90",
|
"version": "1.0.91",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
@ -16,6 +16,7 @@ export type ClientType = typeof ClientType[keyof typeof ClientType]
|
|||||||
///////////////////////
|
///////////////////////
|
||||||
export const InputSampleRate = {
|
export const InputSampleRate = {
|
||||||
"48000": 48000,
|
"48000": 48000,
|
||||||
|
"44100": 44100,
|
||||||
"24000": 24000
|
"24000": 24000
|
||||||
} as const
|
} as const
|
||||||
export type InputSampleRate = typeof InputSampleRate[keyof typeof InputSampleRate]
|
export type InputSampleRate = typeof InputSampleRate[keyof typeof InputSampleRate]
|
||||||
@ -241,6 +242,7 @@ export type Protocol = typeof Protocol[keyof typeof Protocol]
|
|||||||
|
|
||||||
export const SendingSampleRate = {
|
export const SendingSampleRate = {
|
||||||
"48000": 48000,
|
"48000": 48000,
|
||||||
|
"44100": 44100,
|
||||||
"24000": 24000
|
"24000": 24000
|
||||||
} as const
|
} as const
|
||||||
export type SendingSampleRate = typeof SendingSampleRate[keyof typeof SendingSampleRate]
|
export type SendingSampleRate = typeof SendingSampleRate[keyof typeof SendingSampleRate]
|
||||||
|
@ -14,7 +14,9 @@ import signal
|
|||||||
import sys
|
import sys
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
BUFFER_SIZE = 2048 * 2
|
BUFFER_SIZE = 2048 * 2 * 10
|
||||||
|
SAMPLING_RATE = 44100
|
||||||
|
GAIN = 10
|
||||||
|
|
||||||
|
|
||||||
def setupArgParser():
|
def setupArgParser():
|
||||||
@ -91,7 +93,10 @@ class MyCustomNamespace(socketio.ClientNamespace):
|
|||||||
data = msg[1]
|
data = msg[1]
|
||||||
perf = msg[2]
|
perf = msg[2]
|
||||||
print(f"RT:{responseTime}msec", perf)
|
print(f"RT:{responseTime}msec", perf)
|
||||||
# unpackedData = struct.unpack('<%sh' % (len(data) // struct.calcsize('<h')), data)
|
unpackedData = struct.unpack('<%sh' % (len(data) // struct.calcsize('<h')), data)
|
||||||
|
data = np.array(unpackedData)
|
||||||
|
data = data * GAIN
|
||||||
|
data = struct.pack('<%sh' % len(data), *data)
|
||||||
|
|
||||||
if self.file_output_stream != None:
|
if self.file_output_stream != None:
|
||||||
self.file_output_stream.write(data)
|
self.file_output_stream.write(data)
|
||||||
@ -112,7 +117,7 @@ if __name__ == '__main__':
|
|||||||
audio_input_stream = audio.open(
|
audio_input_stream = audio.open(
|
||||||
format=pyaudio.paInt16,
|
format=pyaudio.paInt16,
|
||||||
channels=1,
|
channels=1,
|
||||||
rate=24000,
|
rate=SAMPLING_RATE,
|
||||||
frames_per_buffer=BUFFER_SIZE,
|
frames_per_buffer=BUFFER_SIZE,
|
||||||
input_device_index=inputDevice,
|
input_device_index=inputDevice,
|
||||||
input=True)
|
input=True)
|
||||||
@ -122,7 +127,7 @@ if __name__ == '__main__':
|
|||||||
audio_output_stream = audio.open(
|
audio_output_stream = audio.open(
|
||||||
format=pyaudio.paInt16,
|
format=pyaudio.paInt16,
|
||||||
channels=1,
|
channels=1,
|
||||||
rate=24000,
|
rate=SAMPLING_RATE,
|
||||||
frames_per_buffer=BUFFER_SIZE,
|
frames_per_buffer=BUFFER_SIZE,
|
||||||
output_device_index=outputDevice,
|
output_device_index=outputDevice,
|
||||||
output=True)
|
output=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user