rawaudioparse

This element parses incoming data as raw audio samples and timestamps it. It also handles seek queries in said raw audio data, and ensures that output buffers contain an integer number of samples, even if the input buffers don't. For example, with sample format S16LE and 2 channels, an input buffer of 411 bytes contains 102.75 samples. rawaudioparse will then output 102 samples (= 408 bytes) and keep the remaining 3 bytes. These will then be prepended to the next input data.

Currently, this parser supports raw data in a-law, mu-law, or linear PCM format.

To facilitate operation with the unalignedaudioparse element, rawaudioparse supports the "audio/x-unaligned-raw" media type. This is treated identically to "audio/x-raw", except that it is used by source elements which do not guarantee that the buffers they push out are timestamped and contain an integer amount of samples (see the 411 bytes example above). By using a different media type, it is guaranteed that unalignedaudioparse is autoplugged, making sure that the autoplugged chain does not push unparsed content downstream. The source caps' media type with linear PCM data is always "audio/x-raw", even if the sink caps use "audio/x-unaligned-raw".

The channel-positions property can be used to set explicit position information for each channel. If the array that is passed to this property does not match the number of channels indicated by num-channels, then said number of channels is updated to the array length. If channel-positions is NULL, then the default GStreamer positioning is used. This property is also useful for swapping left and right in a stereo signal for example.

Example pipelines

 gst-launch-1.0 souphttpsrc http://my-dlna-server/track.l16 \
     rawaudioparse ! audioconvert ! audioresample ! autoaudiosink

Receive L16 data from a DLNA server, parse and timestamp it with rawaudioparse, and play it. use-sink-caps is set to true since souphttpsrc will set its source pad's caps to audio/x-unaligned-raw for the L16 stream.

 gst-launch-1.0 filesrc location=audio.raw ! rawaudioparse use-sink-caps=false \
         format=pcm pcm-format=s16le sample-rate=48000 num-channels=2 \
         audioconvert ! audioresample ! autoaudiosink

Read raw data from a local file and parse it as PCM data with 48000 Hz sample rate, signed 16 bit integer samples, and 2 channels. use-sink-caps is set to false to ensure the property information is used and the parser does not expect audio/x-raw or audio/x-unaligned-raw caps.

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBaseParse
                    ╰──GstRawBaseParse
                        ╰──rawaudioparse

Factory details

Authors: – Carlos Rafael Giani

Classification:Codec/Parser/Audio

Rank – none

Plugin – rawparse

Package – GStreamer Base Plug-ins

Pad Templates

sink

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

Presencealways

Directionsink

Object typeGstPad


src

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

Presencealways

Directionsrc

Object typeGstPad


Properties

channel-positions

“channel-positions” GValueArray *

Channel positions used on the output

Flags : Read / Write


format

“format” Raw-audio-parse-format *

Format of the raw audio stream

Flags : Read / Write

Default value : pcm (0)


interleaved

“interleaved” gboolean

True if audio has interleaved layout

Flags : Read / Write

Default value : true


num-channels

“num-channels” gint

Number of channels in raw stream

Flags : Read / Write

Default value : 2


pcm-format

“pcm-format” GstAudioFormat *

Format of audio samples in PCM stream (ignored if format property is not set to pcm)

Flags : Read / Write

Default value : s16le (4)


sample-rate

“sample-rate” gint

Rate of audio samples in raw stream

Flags : Read / Write

Default value : 44100


Named constants

Raw-audio-parse-format

Members

pcm (0) – PCM
alaw (2) – A-Law
mulaw (1) – µ-Law

The results of the search are