[gst-devel] audio/x-raw-int and audio/x-raw-float

Iago Toral Quiroga itoral at igalia.com
Fri Jun 12 09:03:16 CEST 2009


El jue, 11-06-2009 a las 12:18 -0300, Guilherme escribió:
> Mates, I am sorry for bothering with a such newb question....
> 
> I am studying in a more depth way gstreamer and I had a little doubt 
> understanding the audio types supported.
> 
> - What's the difference between audio/x-raw-int and audio/x-raw-float?
>     *If I get a sound from alsa when I am using a microphone, is it the 
> raw-int or raw-float?

If you know the element you will use to capture audio, then you can
check its src capabilities to see the formats it can output. For
example, for alsasrc:

gst-inspect-0.10 alsasrc:
...
Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      audio/x-raw-int
             endianness: { 1234, 4321 }
                 signed: { true, false }
                  width: 32
                  depth: 32
                   rate: [ 1, 2147483647 ]
               channels: [ 1, 2147483647 ]
      audio/x-raw-int
             endianness: { 1234, 4321 }
                 signed: { true, false }
                  width: 16
                  depth: 16
                   rate: [ 1, 2147483647 ]
               channels: [ 1, 2147483647 ]
      audio/x-raw-int
                 signed: { true, false }
                  width: 8
                  depth: 8
                   rate: [ 1, 2147483647 ]
               channels: [ 1, 2147483647 ]
...

So this one outputs only in int format and supports 8, 16 and 32 bits
samples.

Elements in gstreamer can work with many formats or just with one in
particular. If the output (src pad) of a certain element does not match
the input (sink pad) of the next in the pipeline, you can add a convert
element (audioconvert in the case of audio) so appropriate conversion is
done.

> I presume the analog to digital conversor will convert the spectrum into 
> 0's and 1's so it would be the raw-int type. So when the raw-float type 
> is used?

Both float and int types are 0's and 1's in the end ;), this has nothing
to do with it.

Hope that helps.

Iago





More information about the gstreamer-devel mailing list