Re: [asterisk-users] Converting MP3 files to wav for Asterisk

2011-03-04 Thread Ishfaq Malik
On Thu, 2011-03-03 at 08:19 -0800, Steve Edwards wrote:
 Try something 'simpler'
 
 mpg123 -q -w ${TEMP} ${INPUT}
 sox ${TEMP} -c 1 -s -w -r 8000 ${OUTPUT}
 
 and see if that helps. Otherwise, how do the 'intermediate' files in
 your 
 process sound? Can you hear when things fall apart? 

I had been having the same issue and this above method has really
improved the quality of my wav files (I had previously been using
sox -V ${INPUT} -r 8000 -c 1 -s ${OUTPUT} resample -ql)

Thanks for that

Ish
-- 
Ishfaq Malik
Software Developer
PackNet Ltd

Office:   0161 660 3062


--
_
-- 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


Re: [asterisk-users] Converting MP3 files to wav for Asterisk

2011-03-03 Thread Steve Edwards

On Thu, 3 Mar 2011, Timothy Smith wrote:

Do you guys know of a better way I can convert mp3 to wav and restore 
quality?


You can't restore quality lost by converting to MP3. You shouldn't be 
'losing' quality by converting from MP3 to WAV.




#!/bin/bash
for i in `ls $1/*mp3`


Using for i in $1/*mp3 will save creating a process.


do
lame -a $i $i.wav


Lame is an MP3 encoder. Specifying '.wav' doesn't create a WAV encoded 
file, just a 'single channel' (because of '-a') MP3 encoded file with 
'.wav' tacked on the end of the file name.



mplayer   -quiet  -vo null  -vc dummy  -ao pcm:waveheader:file=$i.h.wav $i.wav
sox $i.h.wav -t raw -r 8000 -s -2 -c 1 `echo $i|sed s/.mp3/.sln/`


Using sox $i.h.wav -t raw -r 8000 -s -2 -c 1 ${i%.mp3}.sln will save 
creating a process.



done
-


I tried your commands converting an old Pink Floyd track and it sounded 
about as good as I would expect.


Try something 'simpler'

mpg123 -q -w ${TEMP} ${INPUT}
sox ${TEMP} -c 1 -s -w -r 8000 ${OUTPUT}

and see if that helps. Otherwise, how do the 'intermediate' files in your 
process sound? Can you hear when things fall apart?


If you post a link to a sample input file and a 'degraded' output file, 
this may provide more clues.


--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

--
_
-- 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


Re: [asterisk-users] Converting MP3 files to wav for Asterisk

2011-03-02 Thread Thorsten Göllner

Try to convert into gsm instead wav.

sox test.wav -r 8000 -c1 test.gsm

Am 03.03.2011 06:20, schrieb Timothy Smith:

Hi,

I am running a service where I play full songs but MP3 files kept on
crashing my server. I resorted to wav but the quality is really poor
after converting..or even sometimes not audible at all! Do you guys
know of a better way I can convert mp3 to wav and restore quality?
Below is the script I am using, I also  tried the steps at
http://www.voip-info.org/wiki/view/Convert+WAV+audio+files+for+use+in+Asterisk
but it wasnt any better.


#!/bin/bash
for i in `ls $1/*mp3`
do
lame -a $i $i.wav
mplayer   -quiet  -vo null  -vc dummy  -ao pcm:waveheader:file=$i.h.wav $i.wav
sox $i.h.wav -t raw -r 8000 -s -2 -c 1 `echo $i|sed s/.mp3/.sln/`
done
-

Any thoughts please?

Regards,
Tim

--
_
-- 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



--
Thorsten Göllner

OVM Office Voice Media GmbH
Herderstrasse 68
40237 Düsseldorf

Tel.: +49(0)211 / 618 57 53
Fax: +49(0)211 / 618 57 54


--
_
-- 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