Name Type Access Description
bpf int r/w the number of bytes for one frame, this is the size of one sample * channels
channels int r/w the number of channels
finfo GstAudio.AudioFormatInfo r/w the format info of the audio
flags GstAudio.AudioFlags r/w additional audio flags
layout GstAudio.AudioLayout r/w audio layout
position [GstAudio.AudioChannelPosition] r/w the positions for each channel
rate int r/w the audio sample rate


class new ()
  convert (src_fmt, src_val, dest_fmt)
  copy ()
  free ()
  from_caps (caps)
  init ()
  is_equal (other)
  set_format (format, rate, channels, position)
  to_caps ()


class GstAudio.AudioInfo

Information describing audio properties. This information can be filled in from Gst.Caps with GstAudio.AudioInfo.from_caps().

Use the provided macros to access the info in this structure.

classmethod new()[source]
Returns:a new GstAudio.AudioInfo. free with
Return type:GstAudio.AudioInfo

Allocate a new GstAudio.AudioInfo that is also initialized with GstAudio.AudioInfo.init().

convert(src_fmt, src_val, dest_fmt)[source]

True if the conversion was successful.

dest_val:pointer to destination value

Return type:

(bool, dest_val: int)

Converts among various Gst.Format types. This function handles Gst.Format.BYTES, Gst.Format.TIME, and Gst.Format.DEFAULT. For raw audio, Gst.Format.DEFAULT corresponds to audio frames. This function can be used to handle pad queries of the type Gst.QueryType.CONVERT.

Returns:a new GstAudio.AudioInfo. free with
Return type:GstAudio.AudioInfo

Copy a GstAudio.AudioInfo structure.


Free a GstAudio.AudioInfo structure previously allocated with or GstAudio.AudioInfo.copy().

Parameters:caps (Gst.Caps) – a Gst.Caps
Returns:True if caps could be parsed
Return type:bool

Parse caps and update self.


Initialize self with default values.

Parameters:other (GstAudio.AudioInfo) – a GstAudio.AudioInfo
Returns:True if self and other are equal, else False.
Return type:bool

Compares two GstAudio.AudioInfo and returns whether they are equal or not

New in version 1.2.

set_format(format, rate, channels, position)[source]

Set the default info for the audio info of format and rate and channels.

Note: This initializes self first, no values are preserved.

Returns:the new Gst.Caps containing the info of self.
Return type:Gst.Caps

Convert the values of self into a Gst.Caps.