Gjsify LogoGjsify Logo

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

record

Hierarchy

  • AudioConverter

Index

Constructors

  • Create a new #GstAudioConverter that is able to convert between in and out audio formats.

    config contains extra configuration options, see GST_AUDIO_CONVERTER_OPT_* parameters for details about the options and values.

    Parameters

    Returns AudioConverter

Properties

name: string

Methods

  • Convenience wrapper around gst_audio_converter_samples(), which will perform allocation of the output buffer based on the result from gst_audio_converter_get_out_frames().

    Parameters

    Returns [boolean, Uint8Array]

  • free(): void
  • get_in_frames(out_frames: number): number
  • 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

  • get_max_latency(): number
  • get_out_frames(in_frames: number): number
  • 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

  • is_passthrough(): boolean
  • 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

  • reset(): void
  • samples(flags: AudioConverterFlags, in_: object, in_frames: number, out: object, out_frames: number): boolean
  • 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

    • flags: AudioConverterFlags

      extra #GstAudioConverterFlags

    • in_: object

      input frames

    • in_frames: number

      number of input frames

    • out: object

      output frames

    • out_frames: number

      number of output frames

    Returns boolean

  • supports_inplace(): boolean
  • 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

  • update_config(in_rate: number, out_rate: number, config: Gst.Structure): boolean
  • 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

    • in_rate: number

      input rate

    • out_rate: number

      output rate

    • config: Gst.Structure

      a #GstStructure or %NULL

    Returns boolean

  • Create a new #GstAudioConverter that is able to convert between in and out audio formats.

    config contains extra configuration options, see GST_AUDIO_CONVERTER_OPT_* parameters for details about the options and values.

    Parameters

    Returns AudioConverter

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method