&nbsp;&nbsp;&nbsp;&nbsp;Estou&nbsp;tentando&nbsp;rodar&nbsp;áudio&nbsp;no&nbsp;Asterisk,&nbsp;porém&nbsp;estou&nbsp;com&nbsp;dificuldades. &nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Encontrei uma documentação que falava em converter os arquivos WAV em GSM, porém não achei o tal conversor SOX.<br> &nbsp;&nbsp;&nbsp;&nbsp;Alguém teria esse programa ?
<br><br>--------------<br>URL =&gt; <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 &lt;ENTER&gt; 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 &quot;foo.wav&quot; is your main voice menu audio file in WAV format, and &quot;
foo.gsm&quot; is the same file converted to GSM format. If you wanted to, you could use &quot;main-voice-menu.gsm&quot; as the name in place of &quot;foo.gsm&quot;: what matters here is the second file name you use in this command ends in &quot;.gsm&quot;.
<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 &quot;$a&quot; -r 8000 -c1 &quot;`echo $a|sed -e s/wav//`gsm&quot; 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 =&gt; s,1,Background(foo)<br>or<br> exten =&gt; s,1,Background(main-voice-menu)<br>or<br> exten =&gt; s,1,Playback(foo)<br>or<br> exten =&gt; 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>