Best way to do wav to mp3 conversion

Discussion in 'Mac Programming' started by Septih, Feb 18, 2010.

  1. Septih macrumors newbie

    Joined:
    Feb 18, 2010
    #1
    Hello,

    For our mac software, we need to be able to convert wav recordings into mp3 format. I've been looking around on the web for a couple of days but haven't really gotten anywhere close.

    I've looked at lame, got it linked into xcode, but have hit a brick wall of no developer documentation. Mainly I have no idea what the function names I should be linking to are. The closest thing I've got to an example is the c++ one from the source code and that uses the dll.

    I also briefly looked at the apple doc for core audio/audio toolkit. That has sample code for file conversion, but it seems to require snow leopard (i'm using and developing for leopard), so that's no use.

    Has anyone here managed to do wav to mp3 conversion and if so could you possibly point me in the right direction?
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    The QuickTime API can do this, and it's probably the simplest approach to use for a Mac project. Note that QTKit is Snow Leopard only, and therefore cannot be used. You'll see quite a few references to it on Apple's developer site.
     
  3. DoFoT9 macrumors P6

    DoFoT9

    Joined:
    Jun 11, 2007
    Location:
    Singapore
    #3
    i have sucesfully done it using a number of applications, such as QT7 Pro (QT7 can open .wav files, and can save as .aiff, then use iTunes to import to .mp3).

    also a great program named Max can do it for you too.

    they are all GUI tools though, im not familiar with coding and whatnot :(
     
  4. Septih thread starter macrumors newbie

    Joined:
    Feb 18, 2010
    #4
    Right, I've looked into quicktime and had a play around with some code for converting a qtmovie mp3 into a wav and reversed it. This produces an mp3 which plays and I can change the id3 tags for (and it still plays), but everything I've read about quicktime api says that it doesn't include an mp3 encoder, has this changed or have I just got a wav file with a .mp3 extension?
     
  5. DoFoT9 macrumors P6

    DoFoT9

    Joined:
    Jun 11, 2007
    Location:
    Singapore
    #5
    i am fairly certain that iTunes/QT can natively play .wav files. but i am uncertain if you have actually successfully changed the formats as i dont have the file.

    sorry im not very educated on this coding side of things so i can really give you an answer - i hope it presents itself soon :)
     
  6. Septih thread starter macrumors newbie

    Joined:
    Feb 18, 2010
    #6
    I think the uncertainty arose because the wav file I used to test it was the product of testing the initial mp3 -> wav code before I reversed it. For whatever reason the wav held more details about the track than a newly generated one and the conversion back to mp3 used those details.

    Trying from a newly recorded wav showed me that the conversion wasn't really working.
     
  7. MagicWok macrumors 6502a

    Joined:
    Mar 2, 2006
    Location:
    London
    #7
    A good program to use it xACT (X Audio Compression Toolkit) available on the mac for free.

    It can encode into multiple lossless (FLAC, Apple lossless etc) and lossy formats (AAC/MP3 etc), and decode from FLAC to WAV for instance.

    http://mac.softpedia.com/get/Audio/xACT.shtml
     

Share This Page