Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/mp3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@ def play(i=None):
st["out"].close()
st["out"] = None
if st["out"] is None:
st["out"] = bp.audio_out(AudioFormat(song.sample_rate, song.channel_count, 16))
fmt_out = AudioFormat(song.sample_rate, song.channel_count, 16)
try:
# A player can trade latency for fewer dropouts: a board
# with a choice buffers more.
st["out"] = bp.audio_out(fmt_out, latency="buffered")
except TypeError: # an audio_out that takes no latency
st["out"] = bp.audio_out(fmt_out)
# service() refills the decoder's file buffer from this thread
# (the pump on the other core can't read the card): on the app's
# timer, so it stops when the app closes.
Expand Down
Loading