Skip to content

Commit a60a7cd

Browse files
Comments
1 parent b9e5f0d commit a60a7cd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
0.5.2
22
=====
3-
- AudioFlinger: optimize WAV volume scaling
3+
- AudioFlinger: optimize WAV volume scaling for speed and immediately set volume
44

55
0.5.1
66
=====

internal_filesystem/lib/mpos/audio/stream_wav.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,14 @@ def play(self):
323323
# smaller chunk size means less jerks but buffer can run empty
324324
# at 22050 Hz, 16-bit, 2-ch, 4096/4 = 1024 samples / 22050 = 46ms
325325
# with rough volume scaling:
326-
# 4096 => audio stutters during quasibird
326+
# 4096 => audio stutters during quasibird at ~20fps
327327
# 8192 => no audio stutters and quasibird runs at ~16 fps => good compromise!
328328
# 16384 => no audio stutters during quasibird but low framerate (~8fps)
329329
# with optimized volume scaling:
330-
# 8192 => no audio stutters and quasibird runs at ~12fps
331-
chunk_size = 4096*2
330+
# 6144 => audio stutters and quasibird at ~17fps
331+
# 7168 => audio slightly stutters and quasibird at ~16fps
332+
# 8192 => no audio stutters and quasibird runs at ~15fps
333+
chunk_size = 8192
332334
bytes_per_original_sample = (bits_per_sample // 8) * channels
333335
total_original = 0
334336

0 commit comments

Comments
 (0)