updat
This commit is contained in:
parent
9327fb3690
commit
f85842d984
@ -125,7 +125,7 @@ const App = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!voiceChangerClientRef.current || !clientInitialized) {
|
if (!voiceChangerClientRef.current || !clientInitialized) {
|
||||||
console.log("client is not initialized")
|
// console.log("client is not initialized")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
voiceChangerClientRef.current.setRequestParams(microphoneParams)
|
voiceChangerClientRef.current.setRequestParams(microphoneParams)
|
||||||
|
@ -38,7 +38,7 @@ class MMVC_Namespace(socketio.AsyncNamespace):
|
|||||||
audio1 = self.voiceChangerManager.changeVoice(
|
audio1 = self.voiceChangerManager.changeVoice(
|
||||||
gpu, srcId, dstId, timestamp, convertChunkNum, crossFadeLowerValue, crossFadeOffsetRate, crossFadeEndRate, unpackedData)
|
gpu, srcId, dstId, timestamp, convertChunkNum, crossFadeLowerValue, crossFadeOffsetRate, crossFadeEndRate, 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])
|
||||||
|
|
||||||
|
@ -79,10 +79,10 @@ class VoiceChanger():
|
|||||||
|
|
||||||
torch.set_printoptions(edgeitems=2100)
|
torch.set_printoptions(edgeitems=2100)
|
||||||
print("Generated Strengths")
|
print("Generated Strengths")
|
||||||
print(f"cross fade: start:{cf_offset} end:{cf_end} range:{cf_range}")
|
# print(f"cross fade: start:{cf_offset} end:{cf_end} range:{cf_range}")
|
||||||
print(f"target_len:{unpackedData.shape[0]}, prev_len:{len(self.prev_strength)} cur_len:{len(self.cur_strength)}")
|
# print(f"target_len:{unpackedData.shape[0]}, prev_len:{len(self.prev_strength)} cur_len:{len(self.cur_strength)}")
|
||||||
print("Prev", self.prev_strength)
|
# print("Prev", self.prev_strength)
|
||||||
print("Cur", self.cur_strength)
|
# print("Cur", self.cur_strength)
|
||||||
|
|
||||||
# ひとつ前の結果とサイズが変わるため、記録は消去する。
|
# ひとつ前の結果とサイズが変わるため、記録は消去する。
|
||||||
if hasattr(self, 'prev_audio1') == True:
|
if hasattr(self, 'prev_audio1') == True:
|
||||||
@ -159,11 +159,11 @@ class VoiceChanger():
|
|||||||
prev = self.prev_audio1[-1*unpackedData.shape[0]:]
|
prev = self.prev_audio1[-1*unpackedData.shape[0]:]
|
||||||
cur = audio1[-2*unpackedData.shape[0]:-1*unpackedData.shape[0]]
|
cur = audio1[-2*unpackedData.shape[0]:-1*unpackedData.shape[0]]
|
||||||
result = prev * self.prev_strength + cur * self.cur_strength
|
result = prev * self.prev_strength + cur * self.cur_strength
|
||||||
print("merging...", prev.shape, cur.shape)
|
# print("merging...", prev.shape, cur.shape)
|
||||||
else:
|
else:
|
||||||
cur = audio1[-2*unpackedData.shape[0]:-1*unpackedData.shape[0]]
|
cur = audio1[-2*unpackedData.shape[0]:-1*unpackedData.shape[0]]
|
||||||
result = cur
|
result = cur
|
||||||
print("no merging...", cur.shape)
|
# print("no merging...", cur.shape)
|
||||||
self.prev_audio1 = audio1
|
self.prev_audio1 = audio1
|
||||||
|
|
||||||
#print(result)
|
#print(result)
|
||||||
@ -175,7 +175,7 @@ class VoiceChanger():
|
|||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
|
|
||||||
result = result.astype(np.int16)
|
result = result.astype(np.int16)
|
||||||
print("on_request result size:",result.shape)
|
# print("on_request result size:",result.shape)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user