No subject


Sun Jul 19 19:54:31 CDT 2009


/var/lib/asterisk/sounds/soundfile.alaw
/var/lib/asterisk/sounds/soundfile.wav

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

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
just as easy to obtain and use.

murf


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



-- 
Steve Murphy
ParseTree Corp

--000e0cd1b12ec1bdd704870d3463
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">On Thu, May 20, 2010 at 1:49 AM, Pham Qu=
y <span dir=3D"ltr">&lt;<a href=3D"mailto:quyps at vega.com.vn">quyps at vega.com=
.vn</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"mar=
gin: 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&#39;s CLI f&quot; =A0 file convert /var/lib/asterisk/s=
ounds/soundfile.alaw /var/lib/asterisk/sounds/soundfile.wav<br><br>to go fr=
om alaw to mp3, first convert to wav, then use lame &lt;options&gt; /var/li=
b/asterisk/sounds/soundfile.wav=A0=A0 /var/lib/asterisk/sounds/soundfile.mp=
3<br>
<br>sox looks like it can ogg/vorbis, but mine doesn&#39;t list mp3. You mi=
ght 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=
=3D"gmail_quote" style=3D"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=3D"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=3D"h5"><br>
On Thu, 2010-05-20 at 00:50 -0600, Steve Murphy wrote:<br>
&gt; Quyps--<br>
&gt;<br>
&gt; I&#39;ve noticed in general that the ulaw, alaw, gsm, slin files used =
and<br>
&gt; generated by<br>
&gt; asterisk do not have headers (the RIFF stuff), and asterisk is not<br>
&gt; expecting them. in general they<br>
&gt; will louse up Asterisk&#39;s ability to play the sound. They are just =
raw<br>
&gt; data and the extension<br>
&gt; on the file name (.gsm, or .ulaw, etc) is the only clue to the file<br=
>
&gt; format/contents.<br>
&gt;<br>
&gt; In general, if you need a sound file of your own making in a certain<b=
r>
&gt; format, you can convert<br>
&gt; to most of the formats using sox in linux, but really, the best thing<=
br>
&gt; to do is record the source<br>
&gt; sound file in cd-quality sound WAV format, in 44 khz sampling rate, or=
<br>
&gt; higher, and then<br>
&gt; use sox to convert to 8khz format. Asterisk can do some of this via<br=
>
&gt; the file convert CLI<br>
&gt; command, ( on the asterisk cli, type &quot;help file convert&quot;). Y=
ou&#39;d have<br>
&gt; to judge for yourself<br>
&gt; if &quot;file convert tt-weasels.gsm tt-weasels.ulaw&quot; which would=
 convert<br>
&gt; the 8khz gsm format to<br>
&gt; 8 khz ulaw, or &quot;sox -v 0.7 tt-weasels.44khz.wav -r 8000 -c 1 -t s=
w<br>
&gt; tt-weasels.raw;&quot;<br>
&gt; &quot;sox -r 8000 -c 1 -t sw tt-weasels.raw -t ul tt-weasels.ulaw&quot=
; =A0which<br>
&gt; is the way the Asterisk<br>
&gt; sounds are produced from the the cd-quality sounds. They would seem a<=
br>
&gt; bit equivalent.<br>
&gt;<br>
&gt; I wonder if just &quot;sox -v 0.7 tt-weasels.44khz.wav -r 8000 -c 1 -t=
 ul<br>
&gt; tt-weasels.ulaw&quot; would<br>
&gt; sound any better... you audio engineers out there may have an opinion.=
<br>
&gt;<br>
&gt; I&#39;ve personally noted that not all linux distributions provide the=
<br>
&gt; same version of sox;<br>
&gt; some distribute sox with an absolute minimum of sound formats<br>
&gt; built-in. You may have<br>
&gt; to go out and find all the libraries and roll your own sox.<br>
&gt;<br>
&gt; murf<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Wed, May 19, 2010 at 10:34 PM, Pham Quy &lt;<a href=3D"mailto:quyps=
@vega.com.vn">quyps at vega.com.vn</a>&gt; wrote:<br>
&gt; =A0 =A0 =A0 =A0 On Mon, 2010-05-17 at 17:49 +0700, Pham Quy wrote:<br>
&gt; =A0 =A0 =A0 =A0 &gt; On Mon, 2010-05-17 at 13:06 +0700, Pham Quy wrote=
:<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; hi all,<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; I install Asterisk 1.6 on Centos 5.2 (kernel=
 2.6.18-92.el5<br>
&gt; =A0 =A0 =A0 =A0 #1 SMP Tue<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; Jun 10 18:51:06 EDT 2008 x86_64 x86_64 x86_6=
4 GNU/Linux)<br>
&gt; =A0 =A0 =A0 =A0 and do record<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; audio clip with mixmonitor() as alaw file (s=
oftphone is<br>
&gt; =A0 =A0 =A0 =A0 also configured<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; with alaw active only). Using file command i=
 can get the<br>
&gt; =A0 =A0 =A0 =A0 following<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; information<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; 983006584-20100517-125002.alaw: RIFF (little=
-endian) data,<br>
&gt; =A0 =A0 =A0 =A0 WAVE audio,<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; ITU G.711 A-law, mono 8000 Hz<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; But when i install the same system on Centos=
 5.5 (kernel<br>
&gt; =A0 =A0 =A0 =A0 2.6.18-92.el5<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64 x=
86_64 x86_64<br>
&gt; =A0 =A0 =A0 =A0 GNU/Linux) i<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; could get the same information with file com=
mand. File<br>
&gt; =A0 =A0 =A0 =A0 command<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; recognized alaw file as JPEG image:<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; 983006584-20100517-123825.alaw: JPEG image d=
ata<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; I guess i may miss something when i setup th=
e new on on<br>
&gt; =A0 =A0 =A0 =A0 Centos 5.5, but<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; u dont know what it is. Anyone have idea abo=
ut this?<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; please help.<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; Thanks in advance.<br>
&gt; =A0 =A0 =A0 =A0 &gt; &gt; Quyps<br>
&gt; =A0 =A0 =A0 =A0 &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; I did check content of two alaw files (using a he=
x editor)<br>
&gt; =A0 =A0 =A0 =A0 generated<br>
&gt; =A0 =A0 =A0 =A0 &gt; from two aboves cases. For the one fromo CentOS 5=
.2,<br>
&gt; =A0 =A0 =A0 =A0 beginning bytes<br>
&gt; =A0 =A0 =A0 =A0 &gt; look likes :<br>
&gt; =A0 =A0 =A0 =A0 &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; RIFF1^0.WAVEfmt........ at ...@.......fact.....^0.da=
ta.^0...<br>
&gt; =A0 =A0 =A0 =A0 &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; and the one from CentOS 5.5<br>
&gt; =A0 =A0 =A0 =A0 &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; ......................RQVTV........XEMBAX........=
....<br>
&gt; =A0 =A0 =A0 =A0 &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; It seem like the first one have some information =
about file<br>
&gt; =A0 =A0 =A0 =A0 format,<br>
&gt; =A0 =A0 =A0 =A0 &gt; which make our convert tool works correctly, and =
which the<br>
&gt; =A0 =A0 =A0 =A0 second one<br>
&gt; =A0 =A0 =A0 =A0 &gt; doesnt have.<br>
&gt; =A0 =A0 =A0 =A0 &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; Can you explain to me this different, and how can=
 i get the<br>
&gt; =A0 =A0 =A0 =A0 information<br>
&gt; =A0 =A0 =A0 =A0 &gt; as the first one?<br>
&gt; =A0 =A0 =A0 =A0 &gt;<br>
&gt; =A0 =A0 =A0 =A0 &gt; Thanks in advances,<br>
&gt; =A0 =A0 =A0 =A0 &gt; Quyps<br>
&gt;<br>
&gt; =A0 =A0 =A0 =A0 This question have been asked for a while, I really ne=
ed some<br>
&gt; =A0 =A0 =A0 =A0 help<br>
&gt; =A0 =A0 =A0 =A0 here?<br>
&gt;<br>
&gt; =A0 =A0 =A0 =A0 Thanks in advance.<br>
&gt; =A0 =A0 =A0 =A0 Quyps<br>
&gt;<br>
&gt;<br>
&gt; =A0 =A0 =A0 =A0 --<br>
&gt; =A0 =A0 =A0 =A0 ______________________________________________________=
_______________<br>
&gt; =A0 =A0 =A0 =A0 -- Bandwidth and Colocation Provided by<br>
&gt; =A0 =A0 =A0 =A0 <a href=3D"http://www.api-digital.com" target=3D"_blan=
k">http://www.api-digital.com</a> --<br>
&gt; =A0 =A0 =A0 =A0 New to Asterisk? Join us for a live introductory webin=
ar every<br>
&gt; =A0 =A0 =A0 =A0 Thurs:<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <a href=3D"http://www.aste=
risk.org/hello" target=3D"_blank">http://www.asterisk.org/hello</a><br>
&gt;<br>
&gt; =A0 =A0 =A0 =A0 asterisk-users mailing list<br>
&gt; =A0 =A0 =A0 =A0 To UNSUBSCRIBE or update options visit:<br>
&gt; =A0 =A0 =A0 =A0 =A0 <a href=3D"http://lists.digium.com/mailman/listinf=
o/asterisk-users" target=3D"_blank">http://lists.digium.com/mailman/listinf=
o/asterisk-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Steve Murphy<br>
&gt; ParseTree Corp<br>
&gt;<br>
</div></div>&gt; --<br>
<div><div></div><div class=3D"h5">&gt; ____________________________________=
_________________________________<br>
&gt; -- Bandwidth and Colocation Provided by <a href=3D"http://www.api-digi=
tal.com" target=3D"_blank">http://www.api-digital.com</a> --<br>
&gt; New to Asterisk? Join us for a live introductory webinar every Thurs:<=
br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<a href=3D"http://www.asterisk.org/hell=
o" target=3D"_blank">http://www.asterisk.org/hello</a><br>
&gt;<br>
&gt; asterisk-users mailing list<br>
&gt; To UNSUBSCRIBE or update options visit:<br>
&gt; =A0 =A0<a href=3D"http://lists.digium.com/mailman/listinfo/asterisk-us=
ers" target=3D"_blank">http://lists.digium.com/mailman/listinfo/asterisk-us=
ers</a><br>
<br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href=3D"http://www.api-digital.c=
om" target=3D"_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <a href=3D"http://www.asterisk.org/hello" targ=
et=3D"_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
 =A0 <a href=3D"http://lists.digium.com/mailman/listinfo/asterisk-users" ta=
rget=3D"_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a>=
<br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br>Steve Murph=
y<br>ParseTree Corp<br><br>

--000e0cd1b12ec1bdd704870d3463--



More information about the asterisk-users mailing list