john
2004-Jan-20 13:11 UTC
[Asterisk-Users] Music on Hold - can it be done without mpg123?
I have been having periodic trouble with mpg123. I have tried .59r & .59s and perhaps others a while back and still get the 'broken pipe' and zombie mpg123s (although I think I saw something about a fix in the changelog) once and a while. Is it currently possible to configure moh to run directly on the wav files? Now-a-days hard drives are so big, why use compression at all (at least for local files)? John Harragin This e-mail was scanned and found clean by Monroe-Woodbury's Antivirus.
James H. Cloos Jr.
2004-Jan-20 19:54 UTC
[Asterisk-Users] Re: Music on Hold - can it be done without mpg123?
With a bit of coding it can be done w/o mp3. asterisk/res/res_musiconhold.c needs to me modified to know how to handle some other format. I'd suggest 16-bit mono pcm files with either wav or au headers. If you are only dumping your MoH to zap ports, g.711 with wav or au headers is also a good choice. Current versions of sox(1) can convert even mp3 and ogg/vorbis to uncompressed formats such as pcm. Try: sox file.ogg -s -w -c 1 -r 8000 file.au resample -ql or: sox file.mp3 -s -w -c 1 -r 8000 file.au resample -ql as applicable. Use -U or -A rather than -s -w to convert to mulaw or alaw g.711. Use -g instead of -s -w to convert to gsm. (In the gsm case you may as well use a .gsm suffix; the resulting files will be the same as the sound files shipped w/ *.) Once you have the files converted, edit res_musiconhold.c:moh_register and add support for your chosen file format. Look for the line: ast_log(LOG_WARNING, "Don't know how to do a mode '%s' music on hold\n", mode); Another alternative is to write your own MoH app (it could even be an EAGI) that does whatever you like. -JimC