On Tue, 12 Aug 2008 16:34:07 -0400, J. Todd Slack <[EMAIL PROTECTED]> wrote: > Hi All, > > I am writing a small OS X application that I want to take 15 seconds > from an MP3 and write it out as its own mp3 for use as a ring tone. > ( just got a new iphone)
If you just want to accomplish your goal once, then libav is overkill. Just get some audio tools like lame's command line utility, and sox, and then convert the mp3 to 'raw' format. Then write a 10-line C program that cuts a byte range out of the resulting file, and then convert back to mp3. But, if you want a reusable utility, read on. > Can FFMpeg do this? With LAME right? > > I downloaded LAME and compiled it for OS X, but I do not find any API > reference or documentation or examples on how to use LAME to > accomplish this task. > > Can anyone set me on the right track? Well, this isn't the right list to ask LAME questions. (no pun intended) If you want to use libav, then check out Dranger's tutorial: http://www.dranger.com/ffmpeg/ The Dranger tutorial is really just a nice long explanation of the source code of ffplay.c, which is found in the ffmpeg source repo (svn://svn.mplayerhq.hu/ffmpeg/trunk) That will teach you how to decode (and you can ignore the multithreading part), and then for encoding you'll need to review output_example.c (also in the ffmpeg source repo) You can also review the code of ffmpeg.c, which is the command line tool that pretty much does everything that libav* is capable of. Your program would basically init libav*, then open the input file, load the codec for it, open the output file and codec, attempt to seek to a specific time, and then decode some quantity of audio while re-encoding it to the output file. You could also attempt to get really fancy and directly copy mp3 packets. Hope that helps. -- Michael Conrad IntelliTree Solutions llc. 513-552-6362 [EMAIL PROTECTED] _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
