Documentation
¶
Index ¶
Constants ¶
View Source
const ( BufferTimeMicro = 500_000 NumPeriods = 4 // number of periods requested )
Variables ¶
View Source
var ErrBufferClosed = errors.New("buffer closed")
Functions ¶
This section is empty.
Types ¶
type NewOutputOptions ¶
type NewOutputOptions struct {
// Reader provides data for the output device.
//
// The format of data is as follows:
//
// [data] = [sample 1] [sample 2] [sample 3] ...
// [sample *] = [channel 1] [channel 2] ...
// [channel *] = [byte 1] [byte 2] ...
//
// Byte ordering is little endian.
Reader librespot.Float32Reader
// SampleRate specifies the number of samples that should be played during one second.
// Usual numbers are 44100 or 48000. One context has only one sample rate. You cannot play multiple audio
// sources with different sample rates at the same time.
SampleRate int
// ChannelCount specifies the number of channels. One channel is mono playback. Two
// channels are stereo playback. No other values are supported.
ChannelCount int
// Device specifies the audio device name.
//
// This feature is support only for the unix driver.
Device string
// Mixer specifies the audio mixer name.
//
// This feature is support only for the unix driver.
Mixer string
// Control specifies the mixer control name
//
// This only works in combination with Mixer
Control string
// InitialVolume specifies the initial output volume.
InitialVolume float32
// ExternalVolume specifies, if the volume is controlled outside of the app.
ExternalVolume bool
ExternalVolumeUpdate *RingBuffer[float32]
}
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
func NewOutput ¶
func NewOutput(options *NewOutputOptions) (*Output, error)
type RingBuffer ¶
type RingBuffer[T any] struct { // contains filtered or unexported fields }
func NewRingBuffer ¶
func NewRingBuffer[T any](capacity uint64) *RingBuffer[T]
func (*RingBuffer[T]) Clear ¶
func (rb *RingBuffer[T]) Clear()
func (*RingBuffer[T]) Close ¶
func (rb *RingBuffer[T]) Close() error
func (*RingBuffer[T]) Get ¶
func (rb *RingBuffer[T]) Get() (T, bool, error)
func (*RingBuffer[T]) GetWait ¶
func (rb *RingBuffer[T]) GetWait() (T, error)
func (*RingBuffer[T]) Put ¶
func (rb *RingBuffer[T]) Put(item T) error
func (*RingBuffer[T]) PutWait ¶
func (rb *RingBuffer[T]) PutWait(item T) error
func (*RingBuffer[T]) Size ¶
func (rb *RingBuffer[T]) Size() int
Click to show internal directories.
Click to hide internal directories.