jacdac.arcade_sound

Submodules

Package Contents

Classes

ArcadeSoundClient

A sound playing device.

class jacdac.arcade_sound.ArcadeSoundClient(bus: jacdac.bus.Bus, role: str)

Bases: jacdac.bus.Client

A sound playing device.
  • This is typically run over an SPI connection, not regular single-wire Jacdac.

Implements a client for the Arcade Sound service.

property sample_rate Optional[float]

Get or set playback sample rate (in samples per second). If you set it, read it back, as the value may be rounded up or down., _: Hz

property buffer_size Optional[int]

The size of the internal audio buffer., _: B

property buffer_pending Optional[int]

How much data is still left in the buffer to play. Clients should not send more data than buffer_size - buffer_pending, but can keep the buffer_pending as low as they want to ensure low latency of audio playback., _: B

play(samples: bytes) None

Play samples, which are single channel, signed 16-bit little endian values.