[Live-devel] Darwin Streaming Server and Audio Problem

Keith kgurganus at 650dialup.com
Fri Feb 18 08:02:04 PST 2005


> How, specifically, are you trying to use the "LIVE.COM 
> Streaming Media" 
> software?  Are you running "openRTSP", to record a RTSP/RTP 
> audio stream to 
> a file?

I started with the openRTSP example.  I have modified it so that instead of
recording the streams to a file I get the streams in the function
afterGettingFrame callback.  When I get an audio packet data, I decode it
and write it to a wav file.  I know that it is 8000 khz, mono and 16 bit
because I control that on the encoding side so I create the correct wav
header. The packet is encoded with Speex Narrowband and I just decode each
packet as it comes in and write it to the wav file.  When I stop the encode,
I update the sizes in the wav file.  If you listen to the sample I pointed
to in the previous email, you can see that I am creating a good .wav file
with the decoded data I am receiving.  However, the audio does not sound
correct as is it does when I listen to it with the QuickTimePlayer and my
Speex decoder there.  One thing I am assumming at this time is that the
packets are coming in order and none are dropped when I get the call in
afterGettingFrame.  Could this be my problem? I just thought that by
listening to the audio, someone would have a clue to what I need to do.

> Note that 16-bit samples in PCM audio RTP streams are 
> *big-endian*, by 
> definition, whereas in WAV files, they're little endian.  If you use 
> "openRTSP" to record a PCM RTSP/RTP audio stream into a file, 
> and then just 
> add a WAV file header on the front, the audio won't be 
> correct.  Instead, 
> you'll need to byte-swap the audio samples before writing 
> them to a WAV file.

I am encoding the audio stream with my QT Speex component and broadcasting
with QT to a DSS.  I did try swapping the buffer after the decode, but all I
got was garbage sound then.  I think I have the correct endian as the audio
in the sample wav file sounds very close to what it should be.  Maybe I am
wrong there too.

- Keith





More information about the live-devel mailing list