Improved one-liner:

  • mpg123 -s input.mp3 | faac -b 80 -P -X -w -o output.m4b -

The trouble with the above (works on the MacBook) is that you need the terminal, mpg123 and faac. These are all easy to get and install, especially if you are using macports or the fink. I’m using macports now since the fink seems sunk.

No special tools:

Import to AAC in iTunes.

SetFile type to m4b.

(You can either use SetFile (below) or just make a new file with the same contents as the old file, named m4b.) Window users have an easier time of this since there is no resource fork. Mac users may have to use the SetFile program (below) to get the file to be recognized as m4b (instead of m4a). If you don’t have SetFile, this should work too:

  • Put the AAC file somewhere easy to find (like on your Desktop and call it foo.m4a)
  • Start Terminal.app
  • Type this into terminal.app:
  • cd ~/Desktop
  • cat foo.m4a > foo.m4b
  • Voila, You should have foo.m4b that iTunes will think is an audio book. (This Terminal.app hack is untested).
  • Original Procedure (which works with no extra software):
    Starting with an MP3 file is somewhat painful. The overview would be something like:
    iPod Audio Book Process

    1. Create M4A file from MP3 that can be played in iTunes at the appropriate (reduced) bitrate.
    2. Convert the M4A file to an M4B file.
    3. Augment the M4B file with bookmarks or ‘chapters’.

    UPDATE: I have found the right tools and have successfully done this without any intermediate CDs. The results are quite acceptable. Additionally, I’ve been able to use some small tools to digitize books on tape and get them into my iPod too.

    Step 0 : The Right Way (2004.12.15)

    Using mpg123 you can play the MP3 to a stream, (-s), directly into faac, which can write m4b files directly (adding comments at the same time). So Much Better!

    Step 1: The hack

    At present step 1 is something of a hack. I accomplish the first step by burning an audio CD (hack) and re-importing as AAC (M4A) at 80 kpbs. I’d love for there to be a tool I can use to ‘just do it’. I’ve tried the MP4 tools that are floating around, but either I’m doing something wrong or my MP3 files aren’t suitable. What about a tool to convert MP3 to AIFF and then something to encode the AIFF ? Anyone?

    Step 2 : The Switch

    Step 2 above is done in two steps:

    1. Use /Developer/Tools/SetFile
           /Developer/Tools/SetFile -t 'm4b ' 

      (There is a space in the type specification)

    2. Rename the m4a file to m4b
           mv foo.m4a foo.m4b 

    Step 3: The bait.

    There is no step 3. But at least at this point the file shows up as an audio book and you can control the speed and the iPod will remember where you stopped listening and resume once you return. All very handy compared to the vanilla 30 minute MP3 file of a cassette tape side. (whew!)

    14 Responses to “Homegrown Audio Books and iPod”

    1. Adam Roach says:

      Well, your first step can probably be aided by using mpg123 to unroll your mp3 (e.g. “mpg123 -s inputfile.mp3 > uncompressed.L16″) This will get you raw, linear, 16-bit, host-order, stereo, uncompressed audio.

      I think you should be able to feed this directly into faac to encode your AAC files. (e.g. “mpg123 -s inputfile.mp3 | faac -b80 -P -o outputfile.m4b -” on a big-endian processor). As a nice side effect, because faac natively understands .m4b files, this should take care of step 2 for you also.

    2. Robert says:

      Hey, look at http://ipodlounge.com/forums/showthread.php?s=&threadid=45967 for step by step to convert mp3 files (directly w/o cd step) to m4b files using iTunes.
      Problem is some of us are having problems with 4G iPods locking up with homemade m4b files. There is a discussion of the lock up problems at http://www.ipodlounge.com/forums/showthread.php?s=&threadid=46420
      I just found this site with a google search and don’t see how to subscribe or stay in contact, so if you have suggestions, please post them at one of the two threads linked above or email me.
      Hope the mp3 process works for you. I am in the process of revising the step by step post to further simlify it, see last post of first link above.

    3. robert petty says:

      Use stereo in conversion to avoid the bug that locks the 4G and mini lock up with homemade m4b files.
      Mono files kick off a bug and 4G and mini lock up after playing any portion of a mono m4b file.
      Robert

    4. Darque Knyte says:

      This is my process for my 4th gen 40GB Ipod. I am an Audible subscriber, but I have some books from CD’s ripped to MP3’s.

      1. Import MP3 files into iTunes.
      2. Edit—>Preferences
      A. Set the import option to AAC
      B. Set the bitrate to the current bitrate of the mp3’s
      a. I use 128 if they are 192 or higher
      3. Click on song list. CTRL-A (select all)
      4. Right click–>Conver Select to AAC
      5. Go to your iTunes folder where your tunes are
      A. Default (C:\Documents and Settings\YOURNAMEHERE\My Documents\My Music\iTunes\iTunes Music)
      6. rename file extension from YOURSONGNAME.m4a to YOURSONGNAME.m4b

      the files will now remember where you stopped playing them.

    5. Enrique says:

      That last way of doing it is awesome! changing the files to .m4b works seamlessly! Use Wavepad to combine a number of MP3’s into 1. It’s free!

    6. Bob says:

      Enrique thankyou for you comment, I was looking for a free MP3 combiner. Thanks alot!

    7. anon says:

      @Adam Roach

      mpg123 -s input.mp3 | faac -b 80 -P -X -w -o output.m4b -
      ^^ For little endian x86 systems

    8. [...] Polyphase >> Homegrown Audio Books and iPod should have foo.m4b that iTunes will think is an audio What about a tool to convert MP3 to AIFF and then something to All very handy compared to the vanilla 30 minute MP3 file of a cassette tape [...]

    9. Abel says:

      I’m not so ‘pc savvy’. so How do you rename the file to m4b when windows won’t let you see the file extension like the old days?

    10. [...] seems to work fine (The article specified Mac OSX, but it works fine on my Debian box. Just apt-get mpg123), but I’m still [...]

    11. JH says:

      I did the mpg123 -s input.mp3 | faac -b 80 -P -X -w -o output.m4b – thing, but my resulting file sounds like donald duck, i.e. the speech is speeded up.

      So I tried fiddeling with the mpg123 program, and found that if i use

      mpg123 -r 48000 –stereo

      it sounds correct, except that lots of clicks gets in the audio.

      Don’t know what to do about it. Any suggestions?

    12. naisioxerloro says:

      Hi.
      Good design, who make it?

    13. Alan says:

      JH : No suggestions at this point, I’ll try to re-work this when I get some more material to change around.

      Naisioxerloro: Which design, the layout and blog design or the diagram of the original process? The layout is a modification of the seashore theme you can find at http://wpthemeshop.com/free-themes/ , the diagram was made using Omni Graffle Pro from the Omni Group ( http://www.omnigroup.com/ )

    14. You can do the same thing without iTunes (might be useful for batch processing of mp3s -> m4b w/chapters):

      Even though it says for Linux, it’ll work on OSX, MS Windows, *BSD, etc.

      How to create an iTunes/iPod compatible audiobook (MPEG4 m4b) on Linux using MP4Box and mp4v2: http://froebe.net/blog/2009/12/24/how-to-create-an-itunesipod-compatible-audiobook-mpeg4-m4b-on-linux-using-mp4box-and-mp4v2-v1-9-1-it-can-be-done/

      Hope this helps

      jason

    Leave a Reply