1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you had a PIAF Forum account in the vBulletin days, log in with your old credentials. Otherwise, sign up again and we'll get you back in business as soon as we can.
  3. A serious FreePBX vulnerability has been reported. Update your Framework Module immediately. Click here for details.

How do I add music on hold files?

Discussion in 'Help' started by phinphan, Jan 14, 2008.

  1. phinphan Member

    I have tried to add some mp3 files by converting them to 8 bit wav files but am having no success getting them to play. Can anyone suggest the right tool to use to convert an mp3 file to the correct wav format and then the steps to get PBXiaF to recognize it.

    Thanks in advance.

    I will make a $20.00 donation to PBXiaF in the name of whoever provides the solution to this problem!
  2. foneman Guru

    Have you tried to download and run Audacity?
  3. phinphan Member

    I have tried using Audacity to make a short clip and save as an 8bit or 16 bit wav file and upload through the freepbx page. I get an error saying that the lame command was not found or something like that. I can add the files manually but they still do not work.
  4. wardmundy Nerd Uno

    To install LAME: yum install lame

    Or, try sox. You can read all about it in this Nerd Vittles article.
  5. phinphan Member

    Thanks for the suggestion. I did the lame install and I still get the same error [error precessing: "sh: lame: command not found"

    I will give the sox command a try.
  6. wardmundy Nerd Uno

    When you type lame at the command prompt, do you get a "command not found" error? If so, the yum install didn't work. Just do it again. If lame is installed, then there appears to be something else missing in the script you're using that isn't being reported. Here's what I get when I type lame at the command prompt:
    [COLOR=Lime]root@pbx:~ $[/COLOR] [B]lame[/B]
    LAME 32bits version 3.97 (http://www.mp3dev.org/)
    usage: lame [options] <infile> [outfile]
        <infile> and/or <outfile> can be "-", which means stdin/stdout.
         "lame --help"           for general usage information
         "lame --preset help"    for information on suggested predefined settings
         "lame --longhelp"
      or "lame -?"              for a complete options list
  7. phinphan Member

    When I install lame this is the result:

    root@pbx:~ $ yum install lame
    Loading "installonlyn" plugin
    Setting up Install Process
    Setting up repositories
    mondorescue 100% |=========================| 951 B 00:00
    base 100% |=========================| 1.1 kB 00:00
    updates 100% |=========================| 951 B 00:00
    addons 100% |=========================| 951 B 00:00
    extras 100% |=========================| 1.1 kB 00:00
    Reading repository metadata in from local files
    Excluding Packages from CentOS-5 - Base
    Excluding Packages from CentOS-5 - Updates
    Excluding Packages from CentOS-5 - Addons
    Excluding Packages from CentOS-5 - Extras
    Parsing package install arguments
    Nothing to do

    So I guess the lame install did not work. Oh well. Back to the drawing board.
  8. darmock PIAF Developer

  9. phinphan Member

    Google is my friend... Google is my friend... Google is my friend...
  10. phinphan Member

    Darmock - you are the bomb. Google is my friend. Now on to make another $20 "donation" to NV.
  11. tshif Guru

    FreePBX Seems to want LAME by Default -

    FreePBX seems to expect LAME to be in place. Perhaps it should be included in the standard install. In the other hand, perhaps making it available via update scripts is wiser. In that way, you might choose to offer support for LAME and some other way to accomplish the same thing.

    Getting the RPM worked fine by the way - and thank you - as always - for making this info available!
  12. darmock PIAF Developer

    The problem is the licensing of the MP3 codec. Because mp3 is "owned" by a company in germany you MUST pay a licensing fee to them to use it. The lame software has reverse engineered the mp3 codec and made an "interface" so MP3 encoded material can be used. If you read the licensing of the lame software it is to be used for "educational purposes" only. Any other use is illegal (especially in North America where the software police monitor your every move)

    So technically if you live in North America you are breaking the law even using this piece of software. Watch out for the Software police... they drive black vans with parabolic antennas on the roof ... the masquerade as Television news vans... or Direct TV installers

    Seriously this is why all of the major linux distributions do not include lame and make the user download it.
  13. jroper Guru


    Why not just drop your MOH in as wav files - the format it needs to be in is "the file must be PCM Encoded, 16 Bits, at 8000Hz</SPAN>:" to quote FreePBX

    I use wavepad from NCH to do the conversions on my Windows PC. It's free software, if a little stilted unless you upgrade, but good enough.

  14. Calunker New Member

    Ironic that when I Googling for an answer for this problem I ended up here. Google was my friend and you were too. Thanks for the help.

  15. jaray New Member

    I fought getting mp3's onto my box as well through http. Always complained the file size was too big in php.ini. Increasing that didn't even work, so I simply used an scp client (WinSCP) and manually transfered a full length mp3 directly into /var/lib/asterisk/mohmp3. Voila...the file showed up on the music on hold webpage and it works great.

Share This Page