AudioSink

This is the most simple base class for audio sinks that only requires subclasses to implement a set of simple functions:

  • open() :Open the device.
  • prepare() :Configure the device with the specified format.
  • write() :Write samples to the device.
  • reset() :Unblock writes and flush the device.
  • delay() :Get the number of samples written but not yet played

by the device.

  • unprepare() :Undo operations done by prepare.
  • close() :Close the device.

All scheduling of samples and timestamps is done in this base class together with #GstAudioBaseSink using a default implementation of a #GstAudioRingBuffer that uses threads.

class AudioSink : AudioBaseSink {}

Inherited Members

From AudioBaseSink

createRingbuffer
gstaudio.audio_ring_buffer.AudioRingBuffer createRingbuffer()

Create and return the #GstAudioRingBuffer for sink. This function will call the ::create_ringbuffer vmethod and will set sink as the parent of the returned buffer (see gst.object.ObjectGst.setParent).

getAlignmentThreshold
gst.types.ClockTime getAlignmentThreshold()

Get the current alignment threshold, in nanoseconds, used by sink.

getDiscontWait
gst.types.ClockTime getDiscontWait()

Get the current discont wait, in nanoseconds, used by sink.

getDriftTolerance
long getDriftTolerance()

Get the current drift tolerance, in microseconds, used by sink.

getProvideClock
bool getProvideClock()

Queries whether sink will provide a clock or not. See also gst_audio_base_sink_set_provide_clock.

getSlaveMethod
gstaudio.types.AudioBaseSinkSlaveMethod getSlaveMethod()

Get the current slave method used by sink.

reportDeviceFailure
void reportDeviceFailure()

Informs this base class that the audio output device has failed for some reason, causing a discontinuity (for example, because the device recovered from the error, but lost all contents of its ring buffer). This function is typically called by derived classes, and is useful for the custom slave method.

setAlignmentThreshold
void setAlignmentThreshold(gst.types.ClockTime alignmentThreshold)

Controls the sink's alignment threshold.

setCustomSlavingCallback
void setCustomSlavingCallback(gstaudio.types.AudioBaseSinkCustomSlavingCallback callback)

Sets the custom slaving callback. This callback will be invoked if the slave-method property is set to GST_AUDIO_BASE_SINK_SLAVE_CUSTOM and the audio sink receives and plays samples.

setDiscontWait
void setDiscontWait(gst.types.ClockTime discontWait)

Controls how long the sink will wait before creating a discontinuity.

setDriftTolerance
void setDriftTolerance(long driftTolerance)

Controls the sink's drift tolerance.

setProvideClock
void setProvideClock(bool provide)

Controls whether sink will provide a clock or not. If provide is true, gst.element.Element.provideClock will return a clock that reflects the datarate of sink. If provide is false, gst.element.Element.provideClock will return NULL.

setSlaveMethod
void setSlaveMethod(gstaudio.types.AudioBaseSinkSlaveMethod method)

Controls how clock slaving will be performed in sink.