<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1498" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=769395318-27102006><FONT face=Arial color=#0000ff size=2>use
este link, não é necessário instalar nenhum programa.</FONT></SPAN></DIV>
<DIV><SPAN class=769395318-27102006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=769395318-27102006><FONT face=Arial color=#0000ff size=2><A
href="http://www.asteriskguru.com/tools/audio_conversion.php">http://www.asteriskguru.com/tools/audio_conversion.php</A></FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Mensagem original-----<BR><B>De:</B>
asteriskbrasil-bounces@listas.asteriskbrasil.org
[mailto:asteriskbrasil-bounces@listas.asteriskbrasil.org]<B>Em nome de
</B>Gmail - Whinston Rodrigues<BR><B>Enviada em:</B> sexta-feira, 27 de
outubro de 2006 14:09<BR><B>Para:</B>
asteriskbrasil@listas.asteriskbrasil.org<BR><B>Assunto:</B> [AsteriskBrasil]
Playback<BR><BR></FONT></DIV> Estou tentando rodar áudio no Asterisk, porém estou com dificuldades.
<BR> Encontrei uma documentação que falava em
converter os arquivos WAV em GSM, porém não achei o tal conversor
SOX.<BR> Alguém teria esse programa ?
<BR><BR>--------------<BR>URL => <A
href="http://www.voip-info.org/tiki-index.php?page=Convert+WAV+audio+files+for+use+in+Asterisk">http://www.voip-info.org/tiki-index.php?page=Convert+WAV+audio+files+for+use+in+Asterisk
</A><BR><BR><BR>Converting WAV files<BR>You just recorded a fabulous audio
file to use as you main voice menu. Then you realize that Asterisk does not
use WAV format audio for the Playback or Background applications. So what do
you do? How can you convert your WAV files into GSM files that still have good
sound quality? (This is partially false, Asterisk can play anything it has a
format and codec for, including some wav files. See below.) <BR><BR>Note the
differences!<BR><BR>gsm: raw gsm encoding, good for VoIP<BR>wav: MS wav
format, 16 bit linear<BR>WAV: MS wav format, gsm encoded
(wav49)<BR><BR>Converting your WAV files to good GSM files is easier than you
might think if you have the program Sox installed. From the shell prompt,
enter this command: <BR><BR>sox foo.wav -r 8000 foo.gsm resample
-ql<BR><BR>and hit the <ENTER> key. In a few moments you will have a new
GSM format file in the same directory as the original WAV file. In this
example "foo.wav" is your main voice menu audio file in WAV format, and "
foo.gsm" is the same file converted to GSM format. If you wanted to, you could
use "main-voice-menu.gsm" as the name in place of "foo.gsm": what matters here
is the second file name you use in this command ends in ".gsm". <BR><BR>If
your WAV file was in stereo, add the -c1 option to convert to mono, or the
output will sound very strange.<BR><BR>sox foo.wav -r 8000 -c1 foo.gsm
resample -ql<BR><BR>You may get better results if you record your WAV file in
16 bit 8000 Hz mono and then run <BR><BR>sox foo.wav foo.gsm<BR><BR>If you
have multiple WAV files in one directory and you want to convert them all, use
this command:<BR><BR>for a in *.wav; do sox "$a" -r 8000 -c1 "`echo $a|sed -e
s/wav//`gsm" resample -ql; done <BR><BR>Next, move your new foo.gsm file to
the directory: /var/lib/asterisk/sounds<BR><BR>Now you can easily use the
applications Playback and Background in your extensions.conf file to play your
fabulous main voice menu. For example: <BR>exten =>
s,1,Background(foo)<BR>or<BR>exten =>
s,1,Background(main-voice-menu)<BR>or<BR>exten =>
s,1,Playback(foo)<BR>or<BR>exten =>
s,1,Playback(main-voice-menu)<BR><BR><BR>Using WAV files.<BR><BR>Asterisk has
codecs for wav (pcm), gsm, g729, g726, and wav49, all of which can be used for
Playback and Background. However, Asterisk does not understand ADPCM WAV
files. To convert your WAV files to a format which Asterisk can understand,
use the following command: <BR><BR>sox foo-in.wav -r 8000 -c 1 -s -w
foo-out.wav resample -ql<BR><BR>Converting to sln format<BR>Starting from
Asterisk 1.2.0, the .sln (SLINEAR) format seems to be the preferred
format.<BR>To convert wav file to sln, use the following command: <BR><BR>sox
foo-in.wav -t raw -r 8000 -s -w -c 1 foo-out.sln<BR><BR>Converting to a CD
writable format.<BR><BR>So, you've decided to do your call recording in GSM
format as you don't care about quality and you don't want to stuff your disks
full, but how do you write that file to an audio CD to send to somebody who
wants to listen to the call? <BR><BR>sox infile.gsm -r 44100 -a
outfile.wav<BR><BR>creates a file in a format Nero can write to CD. There are
probably better ways of doing it, but it works for
me!<BR><BR><BR></BLOCKQUOTE></BODY></HTML>