From 8c926b1f9fdf496d95faa3afc53b1dc350a3d837 Mon Sep 17 00:00:00 2001 From: min0911Y <1474635462@qq.com> Date: Mon, 30 Dec 2024 23:32:57 +0800 Subject: [PATCH] =?UTF-8?q?=20=E6=92=AD=E6=94=BE=E9=9F=B3=E9=A2=91?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E8=BF=9B=E5=BA=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/kernel/test/soundtest/test-old.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/kernel/test/soundtest/test-old.c b/src/kernel/test/soundtest/test-old.c index abd24cd6..b7f0f17b 100755 --- a/src/kernel/test/soundtest/test-old.c +++ b/src/kernel/test/soundtest/test-old.c @@ -150,10 +150,9 @@ void qoa_player(cstr path) { snd->volume = 1; vsound_open(snd); for (int i = 0; i < qoa.samples; i += snd->bufsize / qoa.channels) { - klogd("writing %d samples", i); vsound_write(snd, data + i * qoa.channels, snd->bufsize / qoa.channels); - printf("\r%d/%d sec", (int)((float)i / (float)qoa.samplerate), - (int)((float)qoa.samples / (float)qoa.samplerate)); + printf("\r %6.2f / %.2f sec", (float)i / (float)qoa.samplerate, + (float)qoa.samples / (float)qoa.samplerate); } vsound_close(snd); free(data); @@ -175,11 +174,11 @@ void mp3_player(cstr path) { snd->volume = 1; vsound_open(snd); for (int i = 0; i < samples; i += snd->bufsize / mp3.channels) { - klogd("writing %d samples", i); vsound_write(snd, data + i * mp3.channels, snd->bufsize / mp3.channels); - printf("\r%d/%d sec", (int)((float)i / (float)mp3.sampleRate), - (int)((float)samples / (float)mp3.sampleRate)); + printf("\r %6.2f / %.2f sec", (float)i / (float)mp3.sampleRate, + (float)samples / (float)mp3.sampleRate); } + printf("\n"); vsound_close(snd); free(data); free(buf1);