Class (GI Struct)

GstAudio-1.0GstAudioAudioConverterSince 1.8

This object is used to convert audio samples from one format to another. The object can perform conversion of:

  • audio format with optional dithering and noise shaping

  • audio samplerate

  • audio channels and channel layout

1.8

Index

Constructors

Properties

Methods

  • Calculate how many input frames are currently needed by convert to produce out_frames of output frames.

    Parameters

    • out_frames: number

      number of output frames

    Returns number

    the number of input frames

  • Get the maximum number of input frames that the converter would need before producing output.

    Returns number

    the latency of convert as expressed in the number of frames.

  • Calculate how many output frames can be produced when in_frames input frames are given to convert.

    Parameters

    • in_frames: number

      number of input frames

    Returns number

    the number of output frames

  • Returns whether the audio converter will operate in passthrough mode. The return value would be typically input to gst_base_transform_set_passthrough()

    Returns boolean

    true when no conversion will actually occur.

  • Reset convert to the state it was when it was first created, clearing any history it might currently have.

    Returns void

  • Perform the conversion with in_frames in in to out_frames in out using convert.

    In case the samples are interleaved, in and out must point to an array with a single element pointing to a block of interleaved samples.

    If non-interleaved samples are used, in and out must point to an array with pointers to memory blocks, one for each channel.

    in may be null, in which case in_frames of silence samples are processed by the converter.

    This function always produces out_frames of output and consumes in_frames of input. Use gst_audio_converter_get_out_frames() and gst_audio_converter_get_in_frames() to make sure in_frames and out_frames are matching and in and out point to enough memory.

    Parameters

    Returns boolean

    true is the conversion could be performed.

  • Returns whether the audio converter can perform the conversion in-place. The return value would be typically input to gst_base_transform_set_in_place()

    Returns boolean

    true when the conversion can be done in place.

  • Set in_rate, out_rate and config as extra configuration for convert.

    in_rate and out_rate specify the new sample rates of input and output formats. A value of 0 leaves the sample rate unchanged.

    config can be null, in which case, the current configuration is not changed.

    If the parameters in config can not be set exactly, this function returns false and will try to update as much state as possible. The new state can then be retrieved and refined with gst_audio_converter_get_config().

    Look at the GST_AUDIO_CONVERTER_OPT_* fields to check valid configuration option and values.

    Parameters

    Returns boolean

    true when the new parameters could be set