Class (GI Struct)

GstAudio-1.0GstAudioAudioStreamAlignSince 1.14

GstAudio.AudioStreamAlign provides a helper object that helps tracking audio stream alignment and discontinuities, and detects discontinuities if possible.

See gst_audio_stream_align_new() for a description of its parameters and gst_audio_stream_align_process() for the details of the processing.

1.14

Index

Constructors

Properties

Methods

  • Free a GstAudioStreamAlign structure previously allocated with gst_audio_stream_align_new() or gst_audio_stream_align_copy().

    Returns void

  • Gets the currently configured alignment threshold.

    Returns number

    The currently configured alignment threshold

  • Returns the number of samples that were processed since the last discontinuity was detected.

    Returns number

    The number of samples processed since the last discontinuity.

  • Timestamp that was passed when a discontinuity was detected, i.e. the first timestamp after the discontinuity.

    Returns number

    The last timestamp at when a discontinuity was detected

  • Processes data with timestamp and n_samples, and returns the output timestamp, duration and sample position together with a boolean to signal whether a discontinuity was detected or not. All non-discontinuous data will have perfect timestamps and durations.

    A discontinuity is detected once the difference between the actual timestamp and the timestamp calculated from the sample count since the last discontinuity differs by more than the alignment threshold for a duration longer than discont wait.

    Note: In reverse playback, every buffer is considered discontinuous in the context of buffer flags because the last sample of the previous buffer is discontinuous with the first sample of the current one. However for this function they are only considered discontinuous in reverse playback if the first sample of the previous buffer is discontinuous with the last sample of the current one.

    Parameters

    • discont: boolean

      if this data is considered to be discontinuous

    • timestamp: number

      a Gst.ClockTime of the start of the data

    • n_samples: number

      number of samples to process

    Returns [boolean, number, number, number]

    true if a discontinuity was detected, false otherwise.

  • Sets alignment_treshold as new alignment threshold for the following processing.

    Parameters

    • alignment_threshold: number

      a new alignment threshold

    Returns void

  • Sets alignment_treshold as new discont wait for the following processing.

    Parameters

    • discont_wait: number

      a new discont wait

    Returns void

  • Sets rate as new sample rate for the following processing. If the sample rate differs this implicitly marks the next data as discontinuous.

    Parameters

    • rate: number

      a new sample rate

    Returns void