This commit is contained in:
w-okada 2023-11-29 05:18:53 +09:00
parent 17597fdaab
commit ceb7d88cd9
9 changed files with 103 additions and 83 deletions

File diff suppressed because one or more lines are too long

View File

@ -10,29 +10,29 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@alexanderolsen/libsamplerate-js": "^2.1.0", "@alexanderolsen/libsamplerate-js": "^2.1.0",
"@dannadori/voice-changer-client-js": "^1.0.177", "@dannadori/voice-changer-client-js": "^1.0.178",
"@dannadori/voice-changer-js": "^1.0.2", "@dannadori/voice-changer-js": "^1.0.2",
"@dannadori/worker-manager": "^1.0.20", "@dannadori/worker-manager": "^1.0.20",
"@fortawesome/fontawesome-svg-core": "^6.4.2", "@fortawesome/fontawesome-svg-core": "^6.5.0",
"@fortawesome/free-brands-svg-icons": "^6.4.2", "@fortawesome/free-brands-svg-icons": "^6.5.0",
"@fortawesome/free-regular-svg-icons": "^6.4.2", "@fortawesome/free-regular-svg-icons": "^6.5.0",
"@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/free-solid-svg-icons": "^6.5.0",
"@fortawesome/react-fontawesome": "^0.2.0", "@fortawesome/react-fontawesome": "^0.2.0",
"@tensorflow/tfjs": "^4.13.0", "@tensorflow/tfjs": "^4.13.0",
"onnxruntime-web": "^1.16.2", "onnxruntime-web": "^1.16.3",
"protobufjs": "^7.2.5", "protobufjs": "^7.2.5",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0" "react-dom": "^18.2.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.23.3", "@babel/core": "^7.23.3",
"@babel/plugin-transform-runtime": "^7.23.3", "@babel/plugin-transform-runtime": "^7.23.4",
"@babel/preset-env": "^7.23.3", "@babel/preset-env": "^7.23.3",
"@babel/preset-react": "^7.23.3", "@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3", "@babel/preset-typescript": "^7.23.3",
"@types/node": "^20.9.2", "@types/node": "^20.10.0",
"@types/react": "^18.2.37", "@types/react": "^18.2.39",
"@types/react-dom": "^18.2.15", "@types/react-dom": "^18.2.17",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"babel-loader": "^9.1.3", "babel-loader": "^9.1.3",
"copy-webpack-plugin": "^11.0.0", "copy-webpack-plugin": "^11.0.0",
@ -52,7 +52,7 @@
"style-loader": "^3.3.3", "style-loader": "^3.3.3",
"ts-loader": "^9.5.1", "ts-loader": "^9.5.1",
"tsconfig-paths": "^4.2.0", "tsconfig-paths": "^4.2.0",
"typescript": "^5.2.2", "typescript": "^5.3.2",
"webpack": "^5.89.0", "webpack": "^5.89.0",
"webpack-cli": "^5.1.4", "webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1" "webpack-dev-server": "^4.15.1"
@ -2355,9 +2355,9 @@
} }
}, },
"node_modules/@babel/plugin-transform-runtime": { "node_modules/@babel/plugin-transform-runtime": {
"version": "7.23.3", "version": "7.23.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.3.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.4.tgz",
"integrity": "sha512-XcQ3X58CKBdBnnZpPaQjgVMePsXtSZzHoku70q9tUAQp02ggPQNM04BF3RvlW1GSM/McbSOQAzEK4MXbS7/JFg==", "integrity": "sha512-ITwqpb6V4btwUG0YJR82o2QvmWrLgDnx/p2A3CTPYGaRgULkDiC0DRA2C4jlRB9uXGUEfaSS/IGHfVW+ohzYDw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-module-imports": "^7.22.15", "@babel/helper-module-imports": "^7.22.15",
@ -2752,9 +2752,9 @@
} }
}, },
"node_modules/@dannadori/voice-changer-client-js": { "node_modules/@dannadori/voice-changer-client-js": {
"version": "1.0.177", "version": "1.0.178",
"resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.177.tgz", "resolved": "https://registry.npmjs.org/@dannadori/voice-changer-client-js/-/voice-changer-client-js-1.0.178.tgz",
"integrity": "sha512-ruNEtkMc6ah8aqJGvZ0AxvqQe/RRTduQcm/pqQPKKwiT96KKZZz5Iv3ra6+UT10F50cRfaOB30lc/pf9TMO38A==", "integrity": "sha512-BYbVNwTvuVq6EDYZ1DSyRXpUaFsh+MNtv/1cVNQjVf8HIvHZQm6JD9vVZoBrKw+UOX3HluS3PWwWuesm88119w==",
"dependencies": { "dependencies": {
"@types/readable-stream": "^4.0.6", "@types/readable-stream": "^4.0.6",
"amazon-chime-sdk-js": "^3.18.2", "amazon-chime-sdk-js": "^3.18.2",
@ -2857,57 +2857,57 @@
} }
}, },
"node_modules/@fortawesome/fontawesome-common-types": { "node_modules/@fortawesome/fontawesome-common-types": {
"version": "6.4.2", "version": "6.5.0",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.2.tgz", "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.0.tgz",
"integrity": "sha512-1DgP7f+XQIJbLFCTX1V2QnxVmpLdKdzzo2k8EmvDOePfchaIGQ9eCHj2up3/jNEbZuBqel5OxiaOJf37TWauRA==", "integrity": "sha512-vYC8oN2l8meu05sRi1j3Iie/HNFAeIxpitYFhsUrBc11TxiMken9QdXnSQ0q16FYsOSt/6soxs5ghdk+VYGiog==",
"hasInstallScript": true, "hasInstallScript": true,
"engines": { "engines": {
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/@fortawesome/fontawesome-svg-core": { "node_modules/@fortawesome/fontawesome-svg-core": {
"version": "6.4.2", "version": "6.5.0",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.4.2.tgz", "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.5.0.tgz",
"integrity": "sha512-gjYDSKv3TrM2sLTOKBc5rH9ckje8Wrwgx1CxAPbN5N3Fm4prfi7NsJVWd1jklp7i5uSCVwhZS5qlhMXqLrpAIg==", "integrity": "sha512-5DrR+oxQr+ruRQ3CEVV8DSCT/q8Atm56+FzAs0P6eW/epW47OmecSpSwc/YTlJ3u5BfPKUBSGyPR2qjZ+5eIgA==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-common-types": "6.4.2" "@fortawesome/fontawesome-common-types": "6.5.0"
}, },
"engines": { "engines": {
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/@fortawesome/free-brands-svg-icons": { "node_modules/@fortawesome/free-brands-svg-icons": {
"version": "6.4.2", "version": "6.5.0",
"resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.4.2.tgz", "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.5.0.tgz",
"integrity": "sha512-LKOwJX0I7+mR/cvvf6qIiqcERbdnY+24zgpUSouySml+5w8B4BJOx8EhDR/FTKAu06W12fmUIcv6lzPSwYKGGg==", "integrity": "sha512-LwIl3b5cH0xjmBS7mcy8+SsSsl/7J4xi3aP+Tr4rDUf2Tab8r1c8NcqC8wP5c+bgphGstyG3QPx7l4b9WtcO5Q==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-common-types": "6.4.2" "@fortawesome/fontawesome-common-types": "6.5.0"
}, },
"engines": { "engines": {
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/@fortawesome/free-regular-svg-icons": { "node_modules/@fortawesome/free-regular-svg-icons": {
"version": "6.4.2", "version": "6.5.0",
"resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.4.2.tgz", "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.5.0.tgz",
"integrity": "sha512-0+sIUWnkgTVVXVAPQmW4vxb9ZTHv0WstOa3rBx9iPxrrrDH6bNLsDYuwXF9b6fGm+iR7DKQvQshUH/FJm3ed9Q==", "integrity": "sha512-RaBW/y0jKcCyEPM+NYuBs3bQXuLYZHnXABQPmg6qwuRxNb2EUmyCcVUECUH2dkFmMjggh/xvl6n6y62Pl19JkA==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-common-types": "6.4.2" "@fortawesome/fontawesome-common-types": "6.5.0"
}, },
"engines": { "engines": {
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/@fortawesome/free-solid-svg-icons": { "node_modules/@fortawesome/free-solid-svg-icons": {
"version": "6.4.2", "version": "6.5.0",
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.2.tgz", "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.5.0.tgz",
"integrity": "sha512-sYwXurXUEQS32fZz9hVCUUv/xu49PEJEyUOsA51l6PU/qVgfbTb2glsTEaJngVVT8VqBATRIdh7XVgV1JF1LkA==", "integrity": "sha512-6ZPq8mme67Q7O9Fbp2O+Z7mPZbcWTsRv555JLftLaTodiV0Wq+99YgMhyQ8O6mgNQfComqS9OEvqs7M8ySA92g==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-common-types": "6.4.2" "@fortawesome/fontawesome-common-types": "6.5.0"
}, },
"engines": { "engines": {
"node": ">=6" "node": ">=6"
@ -4345,9 +4345,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.9.2", "version": "20.10.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.2.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz",
"integrity": "sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg==", "integrity": "sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==",
"dependencies": { "dependencies": {
"undici-types": "~5.26.4" "undici-types": "~5.26.4"
} }
@ -4394,9 +4394,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/react": { "node_modules/@types/react": {
"version": "18.2.37", "version": "18.2.39",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.37.tgz", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.39.tgz",
"integrity": "sha512-RGAYMi2bhRgEXT3f4B92WTohopH6bIXw05FuGlmJEnv/omEn190+QYEIYxIAuIBdKgboYYdVved2p1AxZVQnaw==", "integrity": "sha512-Oiw+ppED6IremMInLV4HXGbfbG6GyziY3kqAwJYOR0PNbkYDmLWQA3a95EhdSmamsvbkJN96ZNN+YD+fGjzSBA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/prop-types": "*", "@types/prop-types": "*",
@ -4405,9 +4405,9 @@
} }
}, },
"node_modules/@types/react-dom": { "node_modules/@types/react-dom": {
"version": "18.2.15", "version": "18.2.17",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.15.tgz", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.17.tgz",
"integrity": "sha512-HWMdW+7r7MR5+PZqJF6YFNSCtjz1T0dsvo/f1BV6HkV+6erD/nA7wd9NM00KVG83zf2nJ7uATPO9ttdIPvi3gg==", "integrity": "sha512-rvrT/M7Df5eykWFxn6MYt5Pem/Dbyc1N8Y0S9Mrkw2WFCRiqUgw9P7ul2NpwsXCSM1DVdENzdG9J5SreqfAIWg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/react": "*" "@types/react": "*"
@ -9744,19 +9744,19 @@
} }
}, },
"node_modules/onnxruntime-common": { "node_modules/onnxruntime-common": {
"version": "1.16.2", "version": "1.16.3",
"resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.16.2.tgz", "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.16.3.tgz",
"integrity": "sha512-S2/wPoW2uaq5WzpStS6XKOsy8EvKZOOdpzq++HpIV6XZYl0EIfoWBV/Pi5PWcJPFBcu7Rkopo/oPk9IbD9qRlw==" "integrity": "sha512-ZZfFzEqBf6YIGwB9PtBLESHI53jMXA+/hn+ACVUbEfPuK2xI5vMGpLPn+idpwCmHsKJNRzRwqV12K+6TQj6tug=="
}, },
"node_modules/onnxruntime-web": { "node_modules/onnxruntime-web": {
"version": "1.16.2", "version": "1.16.3",
"resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.16.2.tgz", "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.16.3.tgz",
"integrity": "sha512-7QrNAqNqvKtETUdypkv6hT1vHvqf2DCzvDti90Doz1xN6qz20EwLIJfq0PovyrfbfSIvT2CU7V+1V4qIqUVH9w==", "integrity": "sha512-8O1xCG/RcNQNYYWvdiQJSNpncVg78OVOFeV6MYs/jx++/b12oje8gYUzKqz9wR/sXiX/8TCvdyHgEjj5gQGKUg==",
"dependencies": { "dependencies": {
"flatbuffers": "^1.12.0", "flatbuffers": "^1.12.0",
"guid-typescript": "^1.0.9", "guid-typescript": "^1.0.9",
"long": "^5.2.3", "long": "^5.2.3",
"onnxruntime-common": "~1.16.2", "onnxruntime-common": "~1.16.3",
"platform": "^1.3.6", "platform": "^1.3.6",
"protobufjs": "^7.2.4" "protobufjs": "^7.2.4"
} }
@ -12273,9 +12273,9 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.2.2", "version": "5.3.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz",
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",

View File

@ -29,13 +29,13 @@
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.23.3", "@babel/core": "^7.23.3",
"@babel/plugin-transform-runtime": "^7.23.3", "@babel/plugin-transform-runtime": "^7.23.4",
"@babel/preset-env": "^7.23.3", "@babel/preset-env": "^7.23.3",
"@babel/preset-react": "^7.23.3", "@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3", "@babel/preset-typescript": "^7.23.3",
"@types/node": "^20.9.2", "@types/node": "^20.10.0",
"@types/react": "^18.2.37", "@types/react": "^18.2.39",
"@types/react-dom": "^18.2.15", "@types/react-dom": "^18.2.17",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"babel-loader": "^9.1.3", "babel-loader": "^9.1.3",
"copy-webpack-plugin": "^11.0.0", "copy-webpack-plugin": "^11.0.0",
@ -55,23 +55,23 @@
"style-loader": "^3.3.3", "style-loader": "^3.3.3",
"ts-loader": "^9.5.1", "ts-loader": "^9.5.1",
"tsconfig-paths": "^4.2.0", "tsconfig-paths": "^4.2.0",
"typescript": "^5.2.2", "typescript": "^5.3.2",
"webpack": "^5.89.0", "webpack": "^5.89.0",
"webpack-cli": "^5.1.4", "webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1" "webpack-dev-server": "^4.15.1"
}, },
"dependencies": { "dependencies": {
"@alexanderolsen/libsamplerate-js": "^2.1.0", "@alexanderolsen/libsamplerate-js": "^2.1.0",
"@dannadori/voice-changer-client-js": "^1.0.177", "@dannadori/voice-changer-client-js": "^1.0.178",
"@dannadori/voice-changer-js": "^1.0.2", "@dannadori/voice-changer-js": "^1.0.2",
"@dannadori/worker-manager": "^1.0.20", "@dannadori/worker-manager": "^1.0.20",
"@fortawesome/fontawesome-svg-core": "^6.4.2", "@fortawesome/fontawesome-svg-core": "^6.5.0",
"@fortawesome/free-brands-svg-icons": "^6.4.2", "@fortawesome/free-brands-svg-icons": "^6.5.0",
"@fortawesome/free-regular-svg-icons": "^6.4.2", "@fortawesome/free-regular-svg-icons": "^6.5.0",
"@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/free-solid-svg-icons": "^6.5.0",
"@fortawesome/react-fontawesome": "^0.2.0", "@fortawesome/react-fontawesome": "^0.2.0",
"@tensorflow/tfjs": "^4.13.0", "@tensorflow/tfjs": "^4.13.0",
"onnxruntime-web": "^1.16.2", "onnxruntime-web": "^1.16.3",
"protobufjs": "^7.2.5", "protobufjs": "^7.2.5",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0" "react-dom": "^18.2.0"

View File

@ -1,12 +1,12 @@
{ {
"name": "@dannadori/voice-changer-client-js", "name": "@dannadori/voice-changer-client-js",
"version": "1.0.177", "version": "1.0.178",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@dannadori/voice-changer-client-js", "name": "@dannadori/voice-changer-client-js",
"version": "1.0.177", "version": "1.0.178",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@types/readable-stream": "^4.0.6", "@types/readable-stream": "^4.0.6",

View File

@ -1,6 +1,6 @@
{ {
"name": "@dannadori/voice-changer-client-js", "name": "@dannadori/voice-changer-client-js",
"version": "1.0.177", "version": "1.0.178",
"description": "", "description": "",
"main": "dist/index.js", "main": "dist/index.js",
"directories": { "directories": {

View File

@ -202,4 +202,4 @@ def getSampleJsonAndModelIds(mode: RVCSampleMode):
RVC_MODEL_DIRNAME = "rvc" RVC_MODEL_DIRNAME = "rvc"
MAX_SLOT_NUM = 200 MAX_SLOT_NUM = 500

View File

@ -1,4 +1,5 @@
import logging import logging
import traceback
class UvicornSuppressFilter(logging.Filter): class UvicornSuppressFilter(logging.Filter):
@ -11,6 +12,24 @@ class NullHandler(logging.Handler):
pass pass
class DebugStreamHandler(logging.StreamHandler):
def emit(self, record):
try:
super().emit(record)
except Exception as e:
print(f"Error logging message: {e}", file=sys.stderr)
traceback.print_exc()
class DebugFileHandler(logging.FileHandler):
def emit(self, record):
try:
super().emit(record)
except Exception as e:
print(f"Error writing log message to file: {e}", file=sys.stderr)
traceback.print_exc()
class VoiceChangaerLogger: class VoiceChangaerLogger:
_instance = None _instance = None
@ -60,16 +79,19 @@ class VoiceChangaerLogger:
def initialize(self, initialize: bool): def initialize(self, initialize: bool):
if not self.logger.handlers: if not self.logger.handlers:
if initialize: if initialize:
file_handler = logging.FileHandler('vcclient.log', encoding='utf-8', mode='w') # file_handler = logging.FileHandler("vcclient.log", encoding="utf-8", mode="w")
file_handler = DebugFileHandler("vcclient.log", encoding="utf-8", mode="w")
else: else:
file_handler = logging.FileHandler('vcclient.log', encoding='utf-8') # file_handler = logging.FileHandler("vcclient.log", encoding="utf-8")
file_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(process)d - %(message)s') file_handler = DebugFileHandler("vcclient.log", encoding="utf-8")
file_formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(process)d - %(message)s")
file_handler.setFormatter(file_formatter) file_handler.setFormatter(file_formatter)
file_handler.setLevel(logging.DEBUG) file_handler.setLevel(logging.DEBUG)
self.logger.addHandler(file_handler) self.logger.addHandler(file_handler)
stream_formatter = logging.Formatter('%(message)s') stream_formatter = logging.Formatter("%(message)s")
stream_handler = logging.StreamHandler() # stream_handler = logging.StreamHandler()
stream_handler = DebugStreamHandler()
stream_handler.setFormatter(stream_formatter) stream_handler.setFormatter(stream_formatter)
stream_handler.setLevel(logging.INFO) stream_handler.setLevel(logging.INFO)
self.logger.addHandler(stream_handler) self.logger.addHandler(stream_handler)

View File

@ -27,9 +27,7 @@ def dummy_callback(data: np.ndarray, frames, times, status):
pass pass
def checkSamplingRate( def checkSamplingRate(deviceId: int, desiredSamplingRate: int, type: ServerAudioDeviceType):
deviceId: int, desiredSamplingRate: int, type: ServerAudioDeviceType
):
if type == "input": if type == "input":
try: try:
with sd.InputStream( with sd.InputStream(
@ -41,7 +39,7 @@ def checkSamplingRate(
pass pass
return True return True
except Exception as e: # NOQA except Exception as e: # NOQA
# print("[checkSamplingRate]", e) print("[checkSamplingRate]", e)
return False return False
else: else:
try: try:
@ -54,7 +52,7 @@ def checkSamplingRate(
pass pass
return True return True
except Exception as e: # NOQA except Exception as e: # NOQA
# print("[checkSamplingRate]", e) print("[checkSamplingRate]", e)
return False return False

View File

@ -281,8 +281,8 @@ class ServerDevice:
self.currentModelSamplingRate = -1 self.currentModelSamplingRate = -1
while True: while True:
if self.settings.serverAudioStated == 0 or self.settings.serverInputDeviceId == -1: if self.settings.serverAudioStated == 0 or self.settings.serverInputDeviceId == -1:
sd._terminate() # sd._terminate()
sd._initialize() # sd._initialize()
time.sleep(2) time.sleep(2)
else: else:
sd._terminate() sd._terminate()