Documentation
¶
Overview ¶
Package audio wraps github.com/ebitengine/oto/v3 for local PCM playback — the "audio decode hooks" slice of the roadmap's Host/App API line, consumed via uiapp.Host.PlayAudio. Decoding (ffmpeg subprocess, for Amp and Vid) stays entirely outside this package; it only plays already- decoded interleaved int16 samples.
Index ¶
Constants ¶
const ( SampleRate = 48000 Channels = 2 )
SampleRate/Channels are the fixed output format every caller must decode to. oto's Context — and the real audio device behind it — is created once per process at a single sample rate/channel count; there is no per-call resampling (oto's own docs: "Creating multiple contexts is NOT supported"). ffmpeg-based decoders should always target these via -ar/-ac flags rather than passing a rate through here.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Playback ¶
type Playback struct {
// contains filtered or unexported fields
}
Playback controls audio started via Play. Pause/Resume map straight onto oto's own Player.Pause/Play — pausing doesn't restart or re-seek anything, and it doubles as backpressure on the whole pipeline for free: once the player stops pulling from the reader, the feeding goroutine's channel send blocks, which blocks whatever's decoding upstream (e.g. an ffmpeg subprocess whose stdout pipe just fills up) — no separate pause signal needs to reach the decoder.