mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-03 00:33:57 +03:00
TEST: show performance
This commit is contained in:
parent
42708e7295
commit
42d40a79bd
@ -97,7 +97,7 @@ class VoiceChanger:
|
|||||||
sola_buffer: AudioInOut
|
sola_buffer: AudioInOut
|
||||||
namespace: socketio.AsyncNamespace | None = None
|
namespace: socketio.AsyncNamespace | None = None
|
||||||
|
|
||||||
localPerformanceShowTime = 0
|
localPerformanceShowTime = 0.0
|
||||||
|
|
||||||
def audio_callback(
|
def audio_callback(
|
||||||
self, indata: np.ndarray, outdata: np.ndarray, frames, times, status
|
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
|
outdata[:] = np.repeat(out_wav, 2).reshape(-1, 2) / 32768.0
|
||||||
all_inference_time = t.secs
|
all_inference_time = t.secs
|
||||||
performance = [all_inference_time] + times
|
performance = [all_inference_time] + times
|
||||||
performance = [round(x * 1000) for x in performance]
|
self.settings.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
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user