Know your ISP.

User #34994   281 posts
Forum Regular

I have the latest trixbox install, which apparently does not support playing back MP3's because they're a hog on the system...

I checked that my system is willing to play back regular WAVs by converting 1 file on my Windows box and testing MusicOnHold playback.

Can someone please tell me EXACTLY how to get Asterisk to play back MP3s or how to convert MP3's to WAV format. I've spent the last ... 3 hours trying and got random noise at best.

I did download and install mpg123, and have been trying something like this:

mpg123 -s 1.mp3 | sox -t raw -r 8000 -s -w -c 1 - 1.wav

posted 2008-Feb-12, 2am AEST
User #20115   3967 posts
Whirlpool Forums Addict

S.R. writes...

how to convert MP3's to WAV

Why not use a Windows program and then copy the files over ?

www.google.com/search?q=...GGL_enAU260AU260

posted 2008-Feb-12, 6am AEST
User #34994   281 posts
Forum Regular

max writes...

Why not use a Windows program and then copy the files over ?

That defeats the learning process :(.

Does noone know how to convert an MP3 to a Music-On-Hold compatible WAV file?

posted 2008-Feb-12, 8pm AEST
User #132630   311 posts
Forum Regular

I've used these instructions astrecipes.net/?n=152 which are similar to yours.
Only it still wasn't quite correct for my application as it was still 16 bit/sample. I opened file in Windows Sound Recorder, properties showed 16 bit/sample, and did save-as to 8 bit/sample. Presumably there is an option in mpg or sox to do this but I don't know what it is.

posted 2008-Feb-12, 9pm AEST
User #110921   1730 posts
Whirlpool Enthusiast

from here
www.enterprisenetworking...icle.php/3569031

so here is one way to do it with lame and sox:

$ lame --decode soundfile1.mp3 soundfile1.wav
$ sox -V soundfile1.wav -r 8000 -c 1 -w soundfile1.raw

You don't need awesome fidelity and full stereo surround for telephones, so this creates an 8kHz sampling rate file in beautiful one-channel (mono) sound. To convert a whole clutch o' files, stick them all in the same directory and do this:

$ for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done
$ for i in *.wav; do echo $i; sox $i ${i%%.wav}.raw ; echo ${i%%.wav}.raw; done


Hope this helps
Cheers

posted 2008-Feb-12, 9pm AEST
Hosted by
WebCentral Australia
Big numbers
983,064 threads
17,337,343 posts
2,021,389 whims sent
3,114 wiki topics
230 ISPs listed
8,099 broadband plans
829 modems & routers
40,940 features filled