audiotestsrc

audiotestsrc

Properties

gboolean can-activate-pull Read / Write
gboolean can-activate-push Read / Write
gdouble freq Read / Write
gboolean is-live Read / Write
gint samplesperbuffer Read / Write
gint64 timestamp-offset Read / Write
gdouble volume Read / Write
GstAudioTestSrcWave wave Read / Write
gboolean apply-tick-ramp Read / Write
guint marker-tick-period Read / Write
gdouble marker-tick-volume Read / Write
guint sine-periods-per-tick Read / Write
guint64 tick-interval Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GstObject
            ╰── GstElement
                ╰── GstBaseSrc
                    ╰── GstAudioTestSrc

Description

AudioTestSrc can be used to generate basic audio signals. It support several different waveforms and allows to set the base frequency and volume. Some waveforms might use additional properties.

Waveform specific notes:

  1. Gaussian white noise

    • Ticks

      Example launch line

      1
      gst-launch-1.0 audiotestsrc ! audioconvert ! autoaudiosink

      This pipeline produces a sine with default frequency, 440 Hz, and the default volume, 0.8 (relative to a maximum 1.0).

      1
      2
      gst-launch-1.0 audiotestsrc wave=2 freq=200 ! tee name=t ! queue ! audioconvert ! \
          autoaudiosink t. ! queue ! audioconvert ! libvisual_lv_scope ! videoconvert ! autovideosink

      In this example a saw wave is generated. The wave is shown using a scope visualizer from libvisual, allowing you to visually verify that the saw wave is correct.

      1
      2
      gst-launch-1.0 audiotestsrc wave=ticks apply-tick-ramp=true tick-interval=100000000 \
          freq=10000 volume=0.4 marker-tick-period=10 sine-periods-per-tick=20 ! autoaudiosink

      This pipeline produces a series of 10 kHz sine wave ticks. Each tick is 20 sine wave periods long, ticks occur every 100 ms and have a volume of 0.4. Every 10th tick is a marker tick and has the default marker tick volume of 1.0. The beginning and end of the ticks are modulated with the ramp.

      Synopsis

      Element Information

      plugin

      audiotestsrc

      author

      Stefan Kost <ensonic@users.sf.net>

      class

      Source/Audio

      Element Pads

      name

      src

      direction

      source

      presence

      always

      details

      audio/x-raw, format=(string){ S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE, S8, U8 }, layout=(string){ interleaved, non-interleaved }, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]

      Functions

      Types and Values

      struct GstAudioTestSrc

      struct GstAudioTestSrc;

      audiotestsrc object structure.


      enum GstAudioTestSrcWave

      Different types of supported sound waves.

      Members

      GST_AUDIO_TEST_SRC_WAVE_SINE

      a sine wave

       

      GST_AUDIO_TEST_SRC_WAVE_SQUARE

      a square wave

       

      GST_AUDIO_TEST_SRC_WAVE_SAW

      a saw wave

       

      GST_AUDIO_TEST_SRC_WAVE_TRIANGLE

      a tringle wave

       

      GST_AUDIO_TEST_SRC_WAVE_SILENCE

      silence

       

      GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE

      white uniform noise

       

      GST_AUDIO_TEST_SRC_WAVE_PINK_NOISE

      pink noise

       

      GST_AUDIO_TEST_SRC_WAVE_SINE_TAB

      sine wave using a table

       

      GST_AUDIO_TEST_SRC_WAVE_TICKS

      periodic ticks

       

      GST_AUDIO_TEST_SRC_WAVE_GAUSSIAN_WHITE_NOISE

      white (zero mean) Gaussian noise

       

      GST_AUDIO_TEST_SRC_WAVE_RED_NOISE

      red (brownian) noise

       

      GST_AUDIO_TEST_SRC_WAVE_BLUE_NOISE

      spectraly inverted pink noise

       

      GST_AUDIO_TEST_SRC_WAVE_VIOLET_NOISE

      spectraly inverted red (brownian) noise

       

      Property Details

      The “can-activate-pull” property

        “can-activate-pull”        gboolean

      Can activate in pull mode.

      Flags: Read / Write

      Default value: FALSE


      The “can-activate-push” property

        “can-activate-push”        gboolean

      Can activate in push mode.

      Flags: Read / Write

      Default value: TRUE


      The “freq” property

        “freq”                     gdouble

      Frequency of test signal. The sample rate needs to be at least 4 times higher.

      Flags: Read / Write

      Allowed values: [0,5.36871e+08]

      Default value: 440


      The “is-live” property

        “is-live”                  gboolean

      Whether to act as a live source.

      Flags: Read / Write

      Default value: FALSE


      The “samplesperbuffer” property

        “samplesperbuffer”         gint

      Number of samples in each outgoing buffer.

      Flags: Read / Write

      Allowed values: >= 1

      Default value: 1024


      The “timestamp-offset” property

        “timestamp-offset”         gint64

      An offset added to timestamps set on buffers (in ns).

      Flags: Read / Write

      Default value: 0


      The “volume” property

        “volume”                   gdouble

      Volume of test signal.

      Flags: Read / Write

      Allowed values: [0,1]

      Default value: 0.8


      The “wave” property

        “wave”                     GstAudioTestSrcWave

      Oscillator waveform.

      Flags: Read / Write

      Default value: Sine


      The “apply-tick-ramp” property

        “apply-tick-ramp”          gboolean

      Apply ramp to tick samples.

      Flags: Read / Write

      Default value: FALSE


      The “marker-tick-period” property

        “marker-tick-period”       guint

      Make every Nth tick a marker tick (= a tick with different volume). Only used if wave = ticks. 0 = no marker ticks.

      Flags: Read / Write

      Default value: 0


      The “marker-tick-volume” property

        “marker-tick-volume”       gdouble

      Volume of marker ticks. Only used if wave = ticks andmarker-tick-period is set to a nonzero value.

      Flags: Read / Write

      Allowed values: [0,1]

      Default value: 1


      The “sine-periods-per-tick” property

        “sine-periods-per-tick”    guint

      Number of sine wave periods in one tick. Only used if wave = ticks.

      Flags: Read / Write

      Allowed values: >= 1

      Default value: 10


      The “tick-interval” property

        “tick-interval”            guint64

      Distance between start of current and start of next tick, in nanoseconds.

      Flags: Read / Write

      Allowed values: >= 1

      Default value: 1000000000