Documentation
¶
Overview ¶
Package audiomedia analyzes immutable local audio and owns cancellable playback. Callers retain ownership of the verified snapshot and must not modify it while an operation runs. The package never reopens its pathname or closes its file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Play ¶
Play starts local audio only when called explicitly. Native PCM/WAV offsets skip complete sample frames. Compressed offsets use output-side decoder seek. Every helper reads verified bytes through pipes; no path or URL reaches it.
func Waveform ¶
Waveform draws uncolored amplitudes on a fixed 0..1 scale. Multiple rows use symmetric Braille columns; a single row uses an eight-level block sparkline. Dimensions are bounded independently from accepted audio size. Zero samples produce a baseline; absent audio produces no invented waveform.
Types ¶
type Analysis ¶
type Analysis struct {
Format string `json:"format"`
Bytes int64 `json:"bytes"`
Duration float64 `json:"duration"`
Peaks []float64 `json:"peaks"`
}
func Analyze ¶
Analyze scans the supplied snapshot without changing its seek offset. A caller may use a context deadline to bound this optional work after preserving audio. Duration counts decoded frames. Each peak is the maximum absolute sample over all channels in its interval; opposite-phase stereo cannot cancel the waveform.
type UnavailableError ¶
UnavailableError identifies a missing optional helper without exposing paths.
func (*UnavailableError) Error ¶
func (e *UnavailableError) Error() string
func (*UnavailableError) Unwrap ¶
func (e *UnavailableError) Unwrap() error