AudioBuffer

A structure containing the result of an audio buffer map operation, which is executed with gstaudio.audio_buffer.AudioBuffer.map. For non-interleaved (planar) buffers, the beginning of each channel in the buffer has its own pointer in the @planes array. For interleaved buffers, the @planes array only contains one item, which is the pointer to the beginning of the buffer, and @n_planes equals 1.

The different channels in @planes are always in the GStreamer channel order.

Members

Functions

unmap
void unmap()

Unmaps an audio buffer that was previously mapped with gstaudio.audio_buffer.AudioBuffer.map.

Static functions

clip
gst.buffer.Buffer clip(gst.buffer.Buffer buffer, gst.segment.Segment segment, int rate, int bpf)

Clip the buffer to the given gst.segment.Segment.

map
bool map(gstaudio.audio_buffer.AudioBuffer buffer, gstaudio.audio_info.AudioInfo info, gst.buffer.Buffer gstbuffer, gst.types.MapFlags flags)

Maps an audio gstbuffer so that it can be read or written and stores the result of the map operation in buffer.

reorderChannels
bool reorderChannels(gst.buffer.Buffer buffer, gstaudio.types.AudioFormat format, gstaudio.types.AudioChannelPosition[] from, gstaudio.types.AudioChannelPosition[] to)

Reorders buffer from the channel positions from to the channel positions to. from and to must contain the same number of positions and the same positions, only in a different order. buffer must be writable.

truncate
gst.buffer.Buffer truncate(gst.buffer.Buffer buffer, int bpf, size_t trim, size_t samples)

Truncate the buffer to finally have samples number of samples, removing the necessary amount of samples from the end and trim number of samples from the beginning.