mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
TEST: show performance
This commit is contained in:
parent
42708e7295
commit
42d40a79bd
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user