[gst-devel] problem using alawdec

Tiago Katcipis katcipis at inf.ufsc.br
Mon Jul 13 20:40:34 CEST 2009


Its not 16 bit alaw, i have to swap every 2 bytes, so i tell the
audioconvert to get a sample of 16bits and swap it from 4321 to 1234. so the
bytes (alaw samples) will be on the right position. I know its kinda odd,
but my alaw file has the samples on the wrong order, so the bytes must be
swaped, something like swap byte[0] with byte[1], byte[2] with byte[3]...and
so goes on. I know i can make a element to do this, but i was trying to
already use what is already done to acomplish the swaping.

Its not a endianess problem, its the alaw samples that are on the wrong
order, i just use the audioconvert endianess to try to swap the samples for
me.

On Mon, Jul 13, 2009 at 2:30 PM, Michael Smith <msmith at xiph.org> wrote:

> On Mon, Jul 13, 2009 at 8:54 AM, Tiago Katcipis<katcipis at inf.ufsc.br>
> wrote:
> > I have a file that is alaw encoded, but the file has the bytes swaped,
> every
> > two bytes must be swaped so the alaw decoder can decode properly. I
> started
> > to try to build a pipe but i got stuck.
> >
> > The pipe:
> >
> > gst-launch -v filesrc location=alaw_inv.dat ! audio/x-raw-int,
> > endianness=4321, channels=1, rate=8000, width=16, depth=16, signed=false
> !
> > audioconvert ! audio/x-raw-int, endianess=1234, channels=1, rate=8000,
> > width=16, depth=16, signed=false ! queue ! audio/x-alaw, rate=8000,
> > channels=1 ! alawdec ! audioconvert ! wavenc ! filesink
> > location=exemplo_convertido.
> > wav
>
> This won't work, because audioconvert won't just do byteswapping on
> unknown data, which is basically what you want.
>
> It also won't work because you seem to have 16 bit a-law? GStreamer's
> alaw decoder doesn't support that; I've never heard of it being used -
> are you sure it's a-law? Regardless, you'll need a special decoder.
>
> Once you have written a decoder for this format, you can make that
> decoder accept the endianness your data is in, so you don't need to
> byteswap beforehand.
>
> Mike
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>



-- 
"it might be a profitable thing to learn Java, but it has no intellectual
value whatsoever" Alexander Stepanov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090713/498e00e9/attachment.htm>


More information about the gstreamer-devel mailing list