<br><br><div class="gmail_quote">On Thu, May 20, 2010 at 1:49 AM, 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;">
Hi,<br>
<br>
How can I convert FROM ALAW file, which generated by asterisk apps<br>
(monitor, or record app), to format (wav or mp3) that is playable by<br>
music player?? Can Sox do this?<br></blockquote><div><br>From alaw to wav, you can use Asterisk's CLI f" file convert /var/lib/asterisk/sounds/soundfile.alaw /var/lib/asterisk/sounds/soundfile.wav<br><br>to go from alaw to mp3, first convert to wav, then use lame <options> /var/lib/asterisk/sounds/soundfile.wav /var/lib/asterisk/sounds/soundfile.mp3<br>
<br>sox looks like it can ogg/vorbis, but mine doesn't list mp3. You might fetch the source for sox and see if it can do mp3; lame is probably<br>just as easy to obtain and use.<br><br>murf<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
<br>
I have an asterisk 1.6.2.6 on my CentOS 5.2. I record audio clip by<br>
mixmonitor app and use file command to check the alaw output, and here<br>
is output:<br>
<br>
---------<br>
<div class="im">983006584-20100517-125002.alaw: RIFF (little-endian) data, WAVE audio,<br>
ITU G.711 A-law, mono 8000 Hz<br>
</div>---------<br>
<br>
How could file command recognize the format as there is no header in the<br>
output file? Or Did I probably miss something making asterisk yield<br>
incorrect alaw files?<br>
<br>
Please help, thanks<br>
<br>
Quyps<br>
<div><div></div><div class="h5"><br>
On Thu, 2010-05-20 at 00:50 -0600, Steve Murphy wrote:<br>
> Quyps--<br>
><br>
> I've noticed in general that the ulaw, alaw, gsm, slin files used and<br>
> generated by<br>
> asterisk do not have headers (the RIFF stuff), and asterisk is not<br>
> expecting them. in general they<br>
> will louse up Asterisk's ability to play the sound. They are just raw<br>
> data and the extension<br>
> on the file name (.gsm, or .ulaw, etc) is the only clue to the file<br>
> format/contents.<br>
><br>
> In general, if you need a sound file of your own making in a certain<br>
> format, you can convert<br>
> to most of the formats using sox in linux, but really, the best thing<br>
> to do is record the source<br>
> sound file in cd-quality sound WAV format, in 44 khz sampling rate, or<br>
> higher, and then<br>
> use sox to convert to 8khz format. Asterisk can do some of this via<br>
> the file convert CLI<br>
> command, ( on the asterisk cli, type "help file convert"). You'd have<br>
> to judge for yourself<br>
> if "file convert tt-weasels.gsm tt-weasels.ulaw" which would convert<br>
> the 8khz gsm format to<br>
> 8 khz ulaw, or "sox -v 0.7 tt-weasels.44khz.wav -r 8000 -c 1 -t sw<br>
> tt-weasels.raw;"<br>
> "sox -r 8000 -c 1 -t sw tt-weasels.raw -t ul tt-weasels.ulaw" which<br>
> is the way the Asterisk<br>
> sounds are produced from the the cd-quality sounds. They would seem a<br>
> bit equivalent.<br>
><br>
> I wonder if just "sox -v 0.7 tt-weasels.44khz.wav -r 8000 -c 1 -t ul<br>
> 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<br>
> same version of sox;<br>
> some distribute sox with an absolute minimum of sound formats<br>
> 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>
> On Wed, May 19, 2010 at 10:34 PM, Pham Quy <<a href="mailto:quyps@vega.com.vn">quyps@vega.com.vn</a>> wrote:<br>
> 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<br>
> #1 SMP Tue<br>
> > > Jun 10 18:51:06 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux)<br>
> and do record<br>
> > > audio clip with mixmonitor() as alaw file (softphone is<br>
> also configured<br>
> > > with alaw active only). Using file command i can get the<br>
> following<br>
> > > information<br>
> > ><br>
> > > 983006584-20100517-125002.alaw: RIFF (little-endian) data,<br>
> 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<br>
> 2.6.18-92.el5<br>
> > > #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64 x86_64 x86_64<br>
> GNU/Linux) i<br>
> > > could get the same information with file command. File<br>
> 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<br>
> 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)<br>
> generated<br>
> > from two aboves cases. For the one fromo CentOS 5.2,<br>
> 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<br>
> format,<br>
> > which make our convert tool works correctly, and which the<br>
> second one<br>
> > doesnt have.<br>
> ><br>
> > Can you explain to me this different, and how can i get the<br>
> 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<br>
> help<br>
> here?<br>
><br>
> Thanks in advance.<br>
> Quyps<br>
><br>
><br>
> --<br>
> _____________________________________________________________________<br>
> -- Bandwidth and Colocation Provided by<br>
> <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<br>
> 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>
><br>
><br>
><br>
> --<br>
> Steve Murphy<br>
> ParseTree Corp<br>
><br>
</div></div>> --<br>
<div><div></div><div class="h5">> _____________________________________________________________________<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>
<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Steve Murphy<br>ParseTree Corp<br><br>