update requirement

This commit is contained in:
wataru 2023-03-17 02:37:31 +09:00
parent 1dbd8b6679
commit 087d0b5722
2 changed files with 14 additions and 40 deletions

View File

@ -1,9 +1,15 @@
torch==1.13.1
numpy==1.24.1 ### いらない? websockets==10.4
python-socketio==5.7.2 uvicorn==0.21.1
fastapi==0.89.1
python-multipart==0.0.5
uvicorn==0.20.0
websockets==10.4
pyOpenSSL==23.0.0 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++

View File

@ -2,7 +2,6 @@ import base64
import struct import struct
import numpy as np import numpy as np
import traceback import traceback
import pyaudio
from fastapi import APIRouter from fastapi import APIRouter
from fastapi.encoders import jsonable_encoder from fastapi.encoders import jsonable_encoder
@ -23,40 +22,9 @@ class MMVC_Rest_VoiceChanger:
self.voiceChangerManager = voiceChangerManager self.voiceChangerManager = voiceChangerManager
self.router = APIRouter() self.router = APIRouter()
self.router.add_api_route("/test", self.test, methods=["POST"]) 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() 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): def test(self, voice: VoiceModel):
try: try:
timestamp = voice.timestamp timestamp = voice.timestamp