Documentation
¶
Overview ¶
Package testcard implements a default gomedia/schema.Source: a generated sine wave tone, suitable as a fallback for a live encoding job when no other source is available. Video (a picture test card) is not implemented yet — only the audio tone.
Index ¶
Constants ¶
const ( DefaultFrequency = 1000.0 // 1kHz tone DefaultVolume = -20.0 // dB, a conservative default level )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opt ¶
Opt configures optional TestCard parameters.
func WithFrequency ¶
WithFrequency sets the tone's frequency in Hz. Default is 1kHz.
func WithVolume ¶
WithVolume sets the tone's volume in decibels. Default is -20dB.
type TestCard ¶
type TestCard struct {
// contains filtered or unexported fields
}
TestCard is a Source that generates a mono sine wave tone. It does not pace itself to real time — NextFrame returns as soon as the next chunk is generated. Pacing is the caller's job: it's dictated by the destination (a live streaming job wants real-time pacing, a batch re-encode doesn't), not something a source should assume.
func New ¶
func New(audio *profile.AudioProfile, opts ...Opt) (*TestCard, error)
New creates a test card source generating a sine wave tone shaped by the given audio profile's sample rate, sample format and channel layout. Only mono, float32 profiles are supported for now (e.g. a profile.AudioProfile for "pcm_f32le" with channel_layout "mono").