Skip to content

audiobusio.I2SOut.play() refuses to play longer audio unless it's set to loop #10792

Description

@j0j026

CircuitPython version and board name

Adafruit CircuitPython 10.0.3 on 2025-10-17; Seeed Xiao ESP32-S3 Sense with ESP32S3

Code/REPL

import board
import audiocore
import audiobusio

audio = audiobusio.I2SOut(board.A2, board.A1, board.A0)

# An example of the samples. It's truncated (they're very long), but the same behaviour happened with anything I tried to play.
samples = array('h', [10390, 10470, 10410, 10230, 10020, 9890, 9920, 10150, 10390, 10440,...

raw_sample = audiocore.RawSample(samples, sample_rate=16000)
audio.play(recording, loop=False)
while audio.playing:
    pass

Behavior

The code runs with no errors, but there is no audio output.

Description

This seems to happen with longer sample arrays, but I don't know exactly how long. This could be an issue with audiocore.RawSample(), instead.

Additional information

Testing the same hardware with code like the sine wave example from https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-audio-out works fine. However, when I loop the audio (with loop=True in audio.play()), I can hear it fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions