mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
in wsl, socketio can not handle some request?
This commit is contained in:
parent
e6d635b2ec
commit
d414b5d3a8
2
client/demo/dist/index.js
vendored
2
client/demo/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -22,12 +22,17 @@ class MMVC_Namespace(socketio.AsyncNamespace):
|
||||
async def on_request_message(self, sid, msg):
|
||||
timestamp = int(msg[0])
|
||||
data = msg[1]
|
||||
unpackedData = np.array(struct.unpack('<%sh' % (len(data) // struct.calcsize('<h')), data))
|
||||
audio1 = self.voiceChangerManager.changeVoice(unpackedData)
|
||||
|
||||
# print("sio result:", len(audio1), audio1.shape)
|
||||
bin = struct.pack('<%sh' % len(audio1), *audio1)
|
||||
await self.emit('response', [timestamp, bin])
|
||||
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))
|
||||
audio1 = self.voiceChangerManager.changeVoice(unpackedData)
|
||||
# print("sio result:", len(audio1), audio1.shape)
|
||||
bin = struct.pack('<%sh' % len(audio1), *audio1)
|
||||
await self.emit('response', [timestamp, bin])
|
||||
|
||||
def on_disconnect(self, sid):
|
||||
# print('[{}] disconnect'.format(datetime.now().strftime('%Y-%m-%d %H:%M:%S')))
|
||||
|
Loading…
Reference in New Issue
Block a user