[Live-devel] Streaming live PCM audio

Ross Finlayson finlayson at live555.com
Tue Feb 19 16:51:03 PST 2013


> I have problems streaming live PCM audio. Audio comes either directly
> from microphone (16-bit LE) or from hardware encoder (A-LAW).

The problem is that a-law audio is *not* PCM, and therefore has a different RTP payload format (if a-law audio is what you're sending).

Specifically, if you're streaming a-law audio, then when you create your "SimpleRTPSink" object, the "rtpPayloadFormatName" parameter should be "PCMA" (and, of course, the "sdpMediaTypeString" parameter will be "audio").  Because a-law audio is 8-bits per sample, you don't do any byte swapping.

If, on the other hand, you are converting the audio from (8-bit) a-law to (16-bit) PCM before streaming it, then you need to (1) make sure that the 16-bit audio is in big-endian order, and (2) use "L16" as the "rtpPayloadFormatName" parameter when you create your "SimpleRTPSink".

> I know that audio is correct, because if I save it to file instead of sending to
> RTPSink, convert to WAV and stream via testWAVAudioStreamer, VLC reproduces
> it correctly.

That works because (presumably) there's an appropriate header in the WAV file that tells "testWAVAudioStreamer" what kind of audio this is.  If you run "testRTSPClient" on the stream, and look at the SDP description, you'll see the proper RTP payload format name name ("PCMA" or "L16") for this audio.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130220/28979c88/attachment.html>


More information about the live-devel mailing list