How to analyze the BPM of AAC file or any library for converting AAC to MP3 file

Discussion in 'Mac Programming' started by iphonemobdev, Feb 9, 2010.

  1. iphonemobdev macrumors newbie

    Joined:
    Jan 29, 2010
    #1
    Hello Friends,

    I am iphone developer and developing one mac application now. This is my first project ever in mac platform.

    I have to analyze the BPM of the songs files. I have done this work for MP3 using FMOD and SoundTouch library.

    But i have to analyze for AAC (M4A ) also but this library doesn't support to AAC format.

    I tried to search library for AAC(M4A) and i did not get any thing for that. So we if could convert this AAC file to MP3 file by programatically in cocoa then we could analyze the bpm of that file.

    I tried to search for converting AAC to Mp3 in cocoa and i got FAAC library but there is no any documentation for integrating with cocoa and its too complex.

    Does anyone know about any other library for analyze BPM for AAC in cocoa project.

    Many Many Thanks.
     
  2. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    libavcodec in FFmpeg is probably what you want. Make sure that you comply with the license requirements though if you are planning on statically linking it for an iPhone app.
     
  3. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #3
    Core Audio might do what you want.

    Have you searched lists.apple.com ?
     
  4. iphonemobdev thread starter macrumors newbie

    Joined:
    Jan 29, 2010
    #4
    Thanks for reply.

    I want to use this library for mac application only.
     
  5. iphonemobdev thread starter macrumors newbie

    Joined:
    Jan 29, 2010
    #5
    Hi,

    I found libavdcodec in ffmpeg but i could not find that how to compile this library in xcode project. Plz can you give me some direction?.

    Many Thanks.
     
  6. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #6
    You compile it on the command line using the standard ./configure make sudo make install routine. Then you just add the dynamic library to your Xcode project.
     
  7. iphonemobdev thread starter macrumors newbie

    Joined:
    Jan 29, 2010
    #7
    Hi,

    I did all the thing like this way and it installed ffmpeg in /usr/local/bin and i can ffmpeg in that directory. But i could not see any libavcodec.dylib in target->info->general.

    Can you suggest any steps, Plz.

    Thanks so much.
     
  8. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #8
    You have to manually add it. libavcodec.dylib will be in /usr/local/lib. You will also need to setup the header search path. I'm not sure if they are installed in /usr/local/include or /usr/local/include/ffmpeg it has been a little while since I have used ffmpeg.
     
  9. iphonemobdev thread starter macrumors newbie

    Joined:
    Jan 29, 2010
    #9
    Thanks for reply again.

    Actually i checked all the directory mentioned by you and i got libavcodec.a in /usr/local/lib but i did not get any libavcodec.dylib. This libavcodec.a is in /usr/local.lib so i can not access that library.
     
  10. iphonemobdev thread starter macrumors newbie

    Joined:
    Jan 29, 2010
    #10
    Hi Cromulent,

    Plz give me some guidelines on this issue.

    Regards,
    iPhoneMobDev
     
  11. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #11
    The libavcodec.a file is a static library. Therefore you can use it but it will require that you statically link it into your application. You will need to setup your Xcode project to use the correct library and header search paths.

    I wrote a blog post on the subject a little while ago:

    Using Open Source Libraries on Mac OS X

    from the sounds of it though you didn't compile it properly or you disabled shared libraries when you ran the configure script to setup FFMPEG.
     
  12. iphonemobdev thread starter macrumors newbie

    Joined:
    Jan 29, 2010
    #12
    Thanks for reply again.

    I tried to open your link but i think it is dead link.

    Thanks.
     
  13. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #13
    Think again.
     
  14. iphonemobdev thread starter macrumors newbie

    Joined:
    Jan 29, 2010
    #14
    Hi,

    Actually i could not open your link.

    I got following static library and header files,

    1. libavcodec.a
    2. libavformat.a
    3. libavutil.a

    I added this library and their header files into my project and there is no error. I can see this library added in Target->Info->General and i have edited the Header Search Path also.

    I can add header file #import “avcodec.h” into xcode project also. I can use all the variables which have been declared in structure of that file. But i am trying to use any function from that class, i am getting some errors like,

    Test.m
    —-
    “-avcodec_register_all”, referenced from:
    -[Test initialize] in Test.o
    Symbol(s) not found
    collect2: id returned 1 exit status
    —-

    Do you what is the problem?

    Many thanks.
     

Share This Page