[asterisk-users] realtime sip peers : musiconhold class

Tiago Geada tiago.geada at gmail.com
Tue Aug 17 07:07:42 CDT 2010


Hi.

Just to let you know, we record voices with audacity, and export audio as
flac, just in case we need to edit it.

Then I have the following sh script:

o# cat convert.sh
#!/bin/sh

today=$(date +%F);

mkdir -p $today/flac;
mkdir -p $today/wav;
mkdir -p $today/ul;

for i in *.flac;
do
        echo "------------"
        echo "Processing $i";
        echo "------------"
        #$filename=
        sox $i -r 8000 -c 1 $(echo $i|rev|cut -d "." -f2-10|rev).wav;
        normalize-audio -a 25dB $(echo $i|rev|cut -d "." -f2-10|rev).wav;
        mv $i $today/flac/;
        sox $(echo $i|cut -d "." -f1).wav $(echo $i|rev|cut -d "."
-f2-10|rev).ul;
        mv $(echo $i|rev|cut -d "." -f2-10|rev).wav $today/wav/;
        mv $(echo $i|rev|cut -d "." -f2-10|rev).ul $today/ul/;
        echo "";
done

echo "All done";


On 17 August 2010 08:07, Jonas Kellens <jonas.kellens at telenet.be> wrote:

>  Can anyone help because I don't understand why Asterisk can not read the
> input file, there is not much info given...
>
> 2 files :
>
> [root at asterisk testing]# file testExtended.wav
> testExtended.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16
> bit, stereo 44100 Hz
> [root at asterisk testing]# file testLong.wav
> testLong.wav: RIFF (little-endian) data, WAVE audio, 20294 channels
> 1414676809 Hz
>
> to mono :
>
> [root at asterisk testing]# sox testExtended.wav -r 8000 -c1
> testExtended2.wav resample -ql
>
> sox sox: effect `resample' is deprecated; see sox(1) for an alternative
> [root at asterisk testing]# sox testLong.wav -r 8000 -c1 testLong2.wav
> resample -ql
>
> sox sox: effect `resample' is deprecated; see sox(1) for an alternative
> sox effects: resample clipped 2 samples; decrease volume?
>
> afterwards :
>
> [root at asterisk testing]# file testLong2.wav
> testLong2.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16
> bit, mono 8000 Hz
> [root at asterisk testing]# file testExtended2.wav
> testExtended2.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16
> bit, mono 8000 Hz
>
> But Asterisk can not open them :
>
> [root at asterisk testing]# asterisk -rx "file convert testExtended2.wav
> testExtended2.alaw"
> Unable to open input file: testExtended2.wav
> [root at asterisk testing]# asterisk -rx "file convert testLong2.wav
> testLong2.alaw"
> Unable to open input file: testLong2.wav
>
>
> Any thoughts ?!
>
>
> Jonas.
>
>
>
> On 08/14/2010 04:30 PM, Motiejus Jakštys wrote:
>
> On Sat, Aug 14, 2010 at 4:24 PM, Jonas Kellens <jonas.kellens at telenet.be>
> wrote:
> >
> > intro extended version.wav: RIFF (little-endian) data, WAVE audio,
> Microsoft
> > PCM, 16 bit, stereo 44100 Hz
> >
>
> You need *MONO, 8000Hz*
>
> $ man sox
>
> --
> Motiejus Jakštys
>
>
> --
> _____________________________________________________________________
> -- 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100817/46fd1ff1/attachment.htm 


More information about the asterisk-users mailing list