Skip to content

MP3Decoder: i2sout.play(mp3decoder, loop=True) doesn't seem to loop #9644

@jepler

Description

@jepler

CircuitPython version

Adafruit CircuitPython 9.2.0-beta.0-2-g2d30b672fa-dirty on 2024-09-18; Raspberry Pi Pico 2 with rp2350a

Code/REPL

# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT

"""
CircuitPython I2S MP3 playback example.
Plays a single MP3 once.
"""
import board
import audiomp3
import audiobusio

audio = audiobusio.I2SOut(board.GP0, board.GP1, board.GP2)

mp3 = audiomp3.MP3Decoder(open("slow.mp3", "rb"))

audio.play(mp3, loop=True)
while audio.playing:
    pass

print("Done playing!")

Behavior

Plays once, then stops

Description

Related: without doing another "open" only a small portion of the audio plays when passing it to .play a second time.

Additional information

This is likely related to the addition of streaming, which cannot loop.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions