From 087d0b572289df1725051756cdb2b1af7f9a75ec Mon Sep 17 00:00:00 2001 From: wataru Date: Fri, 17 Mar 2023 02:37:31 +0900 Subject: [PATCH] update requirement --- server/requirements.txt | 22 ++++++++++------ server/restapi/MMVC_Rest_VoiceChanger.py | 32 ------------------------ 2 files changed, 14 insertions(+), 40 deletions(-) diff --git a/server/requirements.txt b/server/requirements.txt index 4b1d8d2e..dbce832d 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,9 +1,15 @@ -torch==1.13.1 -numpy==1.24.1 -python-socketio==5.7.2 -fastapi==0.89.1 -python-multipart==0.0.5 -uvicorn==0.20.0 -websockets==10.4 + +### いらない? websockets==10.4 +uvicorn==0.21.1 pyOpenSSL==23.0.0 -onnxruntime-gpu==1.13.1 +numpy==1.24.2 +torch==2.0.0 +resampy==0.4.2 +matplotlib==3.7.1 +librosa==0.10.0.post1 +pyworld==0.3.2 +python-socketio==5.7.2 +fastapi==0.94.1 +onnxruntime-gpu==1.14.1 +python-multipart==0.0.6 +# apt-get install g++ \ No newline at end of file diff --git a/server/restapi/MMVC_Rest_VoiceChanger.py b/server/restapi/MMVC_Rest_VoiceChanger.py index 5a44d8ad..45f87d69 100644 --- a/server/restapi/MMVC_Rest_VoiceChanger.py +++ b/server/restapi/MMVC_Rest_VoiceChanger.py @@ -2,7 +2,6 @@ import base64 import struct import numpy as np import traceback -import pyaudio from fastapi import APIRouter from fastapi.encoders import jsonable_encoder @@ -23,40 +22,9 @@ class MMVC_Rest_VoiceChanger: self.voiceChangerManager = voiceChangerManager self.router = APIRouter() self.router.add_api_route("/test", self.test, methods=["POST"]) - self.router.add_api_route("/device", self.get_device, methods=["GET"]) self.tlock = threading.Lock() - def get_device(self): - audio = pyaudio.PyAudio() - audio_input_devices = [] - audio_output_devices = [] - audio_devices = {} - host_apis = [] - - for api_index in range(audio.get_host_api_count()): - host_apis.append(audio.get_host_api_info_by_index(api_index)['name']) - - for x in range(0, audio.get_device_count()): - device = audio.get_device_info_by_index(x) - try: - deviceName = device['name'].encode('shift-jis').decode('utf-8') - except (UnicodeDecodeError, UnicodeEncodeError): - deviceName = device['name'] - - deviceIndex = device['index'] - hostAPI = host_apis[device['hostApi']] - - if device['maxInputChannels'] > 0: - audio_input_devices.append({"kind": "audioinput", "index": deviceIndex, "name": deviceName, "hostAPI": hostAPI}) - if device['maxOutputChannels'] > 0: - audio_output_devices.append({"kind": "audiooutput", "index": deviceIndex, "name": deviceName, "hostAPI": hostAPI}) - audio_devices["audio_input_devices"] = audio_input_devices - audio_devices["audio_output_devices"] = audio_output_devices - - json_compatible_item_data = jsonable_encoder(audio_devices) - return JSONResponse(content=json_compatible_item_data) - def test(self, voice: VoiceModel): try: timestamp = voice.timestamp