Gjsify LogoGjsify Logo

#GstAudioStreamAlign 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.

record

Hierarchy

  • AudioStreamAlign

Index

Constructors

  • new AudioStreamAlign(rate: number, alignment_threshold: number, discont_wait: number): AudioStreamAlign
  • Allocate a new #GstAudioStreamAlign with the given configuration. All processing happens according to sample rate rate, until gst_audio_stream_align_set_rate() is called with a new rate. A negative rate can be used for reverse playback.

    alignment_threshold gives the tolerance in nanoseconds after which a timestamp difference is considered a discontinuity. Once detected, discont_wait nanoseconds have to pass without going below the threshold again until the output buffer is marked as a discontinuity. These can later be re-configured with gst_audio_stream_align_set_alignment_threshold() and gst_audio_stream_align_set_discont_wait().

    Parameters

    • rate: number

      a sample rate

    • alignment_threshold: number

      a alignment threshold in nanoseconds

    • discont_wait: number

      discont wait in nanoseconds

    Returns AudioStreamAlign

Properties

name: string

Methods

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

    Returns void

  • get_alignment_threshold(): number
  • get_discont_wait(): number
  • get_rate(): number
  • get_samples_since_discont(): number
  • get_timestamp_at_discont(): number
  • Timestamp that was passed when a discontinuity was detected, i.e. the first timestamp after the discontinuity.

    Returns number

  • mark_discont(): void
  • process(discont: boolean, timestamp: number, n_samples: number): [boolean, number, number, number]
  • 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 #GstClockTime of the start of the data

    • n_samples: number

      number of samples to process

    Returns [boolean, number, number, number]

  • set_alignment_threshold(alignment_threshold: number): void
  • Sets alignment_treshold as new alignment threshold for the following processing.

    Parameters

    • alignment_threshold: number

      a new alignment threshold

    Returns void

  • set_discont_wait(discont_wait: number): void
  • Sets alignment_treshold as new discont wait for the following processing.

    Parameters

    • discont_wait: number

      a new discont wait

    Returns void

  • set_rate(rate: number): 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

  • new(rate: number, alignment_threshold: number, discont_wait: number): AudioStreamAlign
  • Allocate a new #GstAudioStreamAlign with the given configuration. All processing happens according to sample rate rate, until gst_audio_stream_align_set_rate() is called with a new rate. A negative rate can be used for reverse playback.

    alignment_threshold gives the tolerance in nanoseconds after which a timestamp difference is considered a discontinuity. Once detected, discont_wait nanoseconds have to pass without going below the threshold again until the output buffer is marked as a discontinuity. These can later be re-configured with gst_audio_stream_align_set_alignment_threshold() and gst_audio_stream_align_set_discont_wait().

    Parameters

    • rate: number

      a sample rate

    • alignment_threshold: number

      a alignment threshold in nanoseconds

    • discont_wait: number

      discont wait in nanoseconds

    Returns AudioStreamAlign

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