in wsl, socketio can not handle some request?

This commit is contained in:
wataru 2023-01-09 22:18:56 +09:00
parent e6d635b2ec
commit d414b5d3a8
2 changed files with 12 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -22,9 +22,14 @@ class MMVC_Namespace(socketio.AsyncNamespace):
async def on_request_message(self, sid, msg): async def on_request_message(self, sid, msg):
timestamp = int(msg[0]) timestamp = int(msg[0])
data = msg[1] data = msg[1]
if(isinstance(data, str)):
print(type(data))
print(data)
await self.emit('response', [timestamp, 0])
else:
unpackedData = np.array(struct.unpack('<%sh' % (len(data) // struct.calcsize('<h')), data)) unpackedData = np.array(struct.unpack('<%sh' % (len(data) // struct.calcsize('<h')), data))
audio1 = self.voiceChangerManager.changeVoice(unpackedData) audio1 = self.voiceChangerManager.changeVoice(unpackedData)
# print("sio result:", len(audio1), audio1.shape) # print("sio result:", len(audio1), audio1.shape)
bin = struct.pack('<%sh' % len(audio1), *audio1) bin = struct.pack('<%sh' % len(audio1), *audio1)
await self.emit('response', [timestamp, bin]) await self.emit('response', [timestamp, bin])