TEST: show performance

This commit is contained in:
wataru 2023-05-10 01:26:38 +09:00
parent 42708e7295
commit 42d40a79bd

View File

@ -97,7 +97,7 @@ class VoiceChanger:
sola_buffer: AudioInOut
namespace: socketio.AsyncNamespace | None = None
localPerformanceShowTime = 0
localPerformanceShowTime = 0.0
def audio_callback(
self, indata: np.ndarray, outdata: np.ndarray, frames, times, status
@ -110,16 +110,7 @@ class VoiceChanger:
outdata[:] = np.repeat(out_wav, 2).reshape(-1, 2) / 32768.0
all_inference_time = t.secs
performance = [all_inference_time] + times
performance = [round(x * 1000) for x in performance]
currentTime = time.time()
if currentTime - self.localPerformanceShowTime > 2:
print(
"[Voice Changer] server audio",
self.settings.performance,
)
self.localPerformanceShowTime = currentTime
self.settings.performance = [round(x * 1000) for x in performance]
except Exception as e:
print(e)