Skip to content

Commit

Permalink
小修改
Browse files Browse the repository at this point in the history
  • Loading branch information
min0911Y committed Nov 1, 2024
1 parent 6109504 commit f020f8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/kernel/test/soundtest/test-old.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ void qoa_player(cstr path) {
snd->rate = qoa.samplerate;
snd->volume = 1;
vsound_open(snd);
for (int i = 0; i < qoa.samples; i += 2048) {
for (int i = 0; i < qoa.samples; i += snd->bufsize / qoa.channels) {
klogd("writing %d samples", i);
vsound_write(snd, data + i * qoa.channels, 2048);
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));
}
Expand Down

0 comments on commit f020f8e

Please sign in to comment.