Skip to main content
View source

Player

View as Markdown

A RocketRide audio node that plays incoming audio through the system's default output device in real time.

What it does

Accepts container-format audio bytes (for example WAV or MP3, identified by MIME type) on its audio lane and plays them through the machine's default speakers. Video input is also accepted on the video lane: the audio track is extracted and played while video frames are discarded. This is a terminal node with no output lanes.

Incoming bytes are piped through ffmpeg (the binary bundled with imageio_ffmpeg, so no host ffmpeg install is required), which decodes any common container/codec to raw PCM. Playback is handled by sounddevice (PortAudio) via a low-latency output stream at 44,100 Hz stereo int16.

Playback is serialized engine-wide: a shared threading.Lock created at node startup ensures only one stream plays at a time. Because the node drives a physical audio device, it carries the nosaas capability and is not available in SaaS deployments (local only).


Configuration

Lanes

LaneDirectionBehavior
audioinputDecoded and played through the default output device
videoinputAudio track extracted and played; video frames are discarded

Neither lane produces downstream output. The node is a sink.

Fields

No configuration options: the node exposes no fields and uses a single empty default profile. Playback settings are fixed in the implementation:

ParameterValue
Sample rate44,100 Hz
ChannelsStereo (2)
FormatPCM int16 (internal playback format after decode)
LatencyLow (latency='low', blocksize 1024 frames)
Chunk size16 KB per queued buffer
Queue depth32 chunks maximum (~512 KB, roughly 3 s of audio)

Playback behavior

Decoded PCM is accumulated into 16 KB chunks and placed into a bounded queue. When the queue holds 32 chunks, upstream writes block, providing natural backpressure that prevents unbounded memory growth.

On stop, the node polls until the queue and the internal playback buffer are both fully drained before closing the stream, so buffered audio plays to completion. One known limitation: the final partial frame smaller than the callback blocksize (1024 frames, about 24 ms at 44.1 kHz) is dropped rather than padded with silence. Roughly the last 24 ms of a stream may be cut off.


Schema

No configuration fields.

Dependencies

  • imageio_ffmpeg
  • sounddevice