Speaker¶
Runnable example
python/examples/speaker_record.py — streams for 5 s, prints peak amplitude, and saves raw float32 LE to speaker_output.raw.
resoio.speaker.SpeakerClient ¶
Bases: _BaseClient[SpeakerStub]
Async client for the Resonite IO Speaker service over a UDS.
Use as an async context manager so the gRPC channel is closed
deterministically. Socket resolution mirrors
:class:resoio.ConnectionClient. The wire format is fixed at
48 kHz / Stereo / float32 LE; constants are exposed at module level
(:data:SAMPLE_RATE, :data:CHANNELS, :data:DTYPE).
Source code in src/resoio/_client.py
stream
async
¶
Stream the Resonite final audio mix from the server.
Yields one :class:SpeakerChunk per server-emitted AudioFrame.
Raises :class:RuntimeError if called outside async with.
Source code in src/resoio/speaker.py
resoio.speaker.SpeakerChunk
dataclass
¶
One decoded audio chunk from the speaker stream.
samples is an (N, 2) float32 view over the protobuf payload
bytes (read-only; call .copy() for a writable array). Channels
are interleaved L,R in the wire bytes and reshaped to columns
[L, R]. unix_nanos is the bridge tap timestamp in UTC nanos
since the Unix epoch. frame_id is a server-side monotonic
counter that restarts at 0 per stream() call.