Quyps--<br><br>I've noticed in general that the ulaw, alaw, gsm, slin files used and generated by <br>asterisk do not have headers (the RIFF stuff), and asterisk is not expecting them. in general they<br>will louse up Asterisk's ability to play the sound. They are just raw data and the extension<br>
on the file name (.gsm, or .ulaw, etc) is the only clue to the file format/contents.<br><br>In general, if you need a sound file of your own making in a certain format, you can convert<br>to most of the formats using sox in linux, but really, the best thing to do is record the source<br>
sound file in cd-quality sound WAV format, in 44 khz sampling rate, or higher, and then <br>use sox to convert to 8khz format. Asterisk can do some of this via the file convert CLI<br>command, ( on the asterisk cli, type "help file convert"). You'd have to judge for yourself<br>
if "file convert tt-weasels.gsm tt-weasels.ulaw" which would convert the 8khz gsm format to<br>8 khz ulaw, or "sox -v 0.7 tt-weasels.44khz.wav -r 8000 -c 1 -t sw tt-weasels.raw;"<br>"sox -r 8000 -c 1 -t sw tt-weasels.raw -t ul tt-weasels.ulaw" which is the way the Asterisk<br>
sounds are produced from the the cd-quality sounds. They would seem a bit equivalent.<br><br>I wonder if just "sox -v 0.7 tt-weasels.44khz.wav -r 8000 -c 1 -t ul tt-weasels.ulaw" would<br>sound any better... you audio engineers out there may have an opinion.<br>
<br>I've personally noted that not all linux distributions provide the same version of sox;<br>some distribute sox with an absolute minimum of sound formats built-in. You may have <br>to go out and find all the libraries and roll your own sox.<br>
<br>murf<br><br><br><br><br><br><div class="gmail_quote">On Wed, May 19, 2010 at 10:34 PM, Pham Quy <span dir="ltr"><<a href="mailto:quyps@vega.com.vn">quyps@vega.com.vn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On Mon, 2010-05-17 at 17:49 +0700, Pham Quy wrote:<br>
> On Mon, 2010-05-17 at 13:06 +0700, Pham Quy wrote:<br>
> > hi all,<br>
> ><br>
> > I install Asterisk 1.6 on Centos 5.2 (kernel 2.6.18-92.el5 #1 SMP Tue<br>
> > Jun 10 18:51:06 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux) and do record<br>
> > audio clip with mixmonitor() as alaw file (softphone is also configured<br>
> > with alaw active only). Using file command i can get the following<br>
> > information<br>
> ><br>
> > 983006584-20100517-125002.alaw: RIFF (little-endian) data, WAVE audio,<br>
> > ITU G.711 A-law, mono 8000 Hz<br>
> ><br>
> > But when i install the same system on Centos 5.5 (kernel 2.6.18-92.el5<br>
> > #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux) i<br>
> > could get the same information with file command. File command<br>
> > recognized alaw file as JPEG image:<br>
> ><br>
> > 983006584-20100517-123825.alaw: JPEG image data<br>
> ><br>
> > I guess i may miss something when i setup the new on on Centos 5.5, but<br>
> > u dont know what it is. Anyone have idea about this?<br>
> ><br>
> > please help.<br>
> ><br>
> > Thanks in advance.<br>
> > Quyps<br>
><br>
> I did check content of two alaw files (using a hex editor) generated<br>
> from two aboves cases. For the one fromo CentOS 5.2, beginning bytes<br>
> look likes :<br>
><br>
> RIFF1^0.WAVEfmt........@...@.......fact.....^0.data.^0...<br>
><br>
> and the one from CentOS 5.5<br>
><br>
> ......................RQVTV........XEMBAX............<br>
><br>
> It seem like the first one have some information about file format,<br>
> which make our convert tool works correctly, and which the second one<br>
> doesnt have.<br>
><br>
> Can you explain to me this different, and how can i get the information<br>
> as the first one?<br>
><br>
> Thanks in advances,<br>
> Quyps<br>
<br>
This question have been asked for a while, I really need some help<br>
here?<br>
<br>
Thanks in advance.<br>
Quyps<br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Steve Murphy<br>ParseTree Corp<br><br>