<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Ross,<br>
<br>
Thanks a lot for answering.<br>
<br>
On 02/20/2013 02:51 AM, Ross Finlayson wrote:
<blockquote
cite="mid:E9FF4552-371A-4BA4-BBA2-40FA81A67446@live555.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div>
<blockquote type="cite">
<div bgcolor="#ffffff" text="#000000">I have problems
streaming live PCM audio. Audio comes either directly<br>
from microphone (16-bit LE) or from hardware encoder
(A-LAW).</div>
</blockquote>
<div><br>
</div>
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).</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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".</div>
</blockquote>
<br>
When streaming a-law I do set mime type to "PCMA",
"sdpMediaTypeString" parameter to "audio" and payloadFormatCode to
8, as <br>
it's done in testWAVAudioStreamer. VLC detects the stream as PCM
ALAW, so I don't think that is my problem. However there's a strong<br>
echo and noise in my stream, which do not exist when streaming from
file.<br>
<blockquote
cite="mid:E9FF4552-371A-4BA4-BBA2-40FA81A67446@live555.com"
type="cite">
<div><br>
</div>
<div>
<blockquote type="cite">
<div bgcolor="#ffffff" text="#000000">I know that audio is
correct, because if I save it to file instead of sending to<br>
RTPSink, convert to WAV and stream via testWAVAudioStreamer,
VLC reproduces<br>
it correctly.</div>
</blockquote>
<div><br>
</div>
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.</div>
</blockquote>
<br>
After saving a-law samples to file I use the following command to
convert it to WAV:<br>
<br>
sox -b 8 -e a-law -r 8000 -c 1 test.raw test.wav<br>
<br>
Maybe something is wrong with the way I bundle samples for RTP sink,
or the way I time-stamp them ?<br>
WAVAudioFileStreamer class tries to read several samples from the
file, up to 20 ms, but I already get<br>
a buffer of 160 bytes, which is exactly 20ms for a-law. I set
fPresentationTime on that buffer. <br>
Should I play with OutPacketBuffer::maxSize ?<br>
<br>
Thanks a lot for your help so far.<br>
<br>
Felix.<br>
<br>
</body>
</html>