Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I got an MP3 audiobook download for Christmas.

The downloaded and unzipped files are named in this manner:

  • 01 Prologue.mp3
  • 02 Chapter 1 - Don't start yappin.mp3
  • 03 Chapter 2 - Stack Exchangin your way to success.mp3
  • 04 Chapter 3 - Don't eat that Unicorn meat and three other warnings.mp3
  • 05 Epilogue.mp3

After syncing them to my iPhone and opening the music app I saw that they are displayed in alphabetical order by title:

  • Don't eat that Unicorn meat and three other warnings.
  • Don't start yappin'!
  • Epilogue
  • Stack Exchangin' your way to success.
  • Prologue

Listening in the order they're presented in while I'm driving is bizarre. Is there a way to sort audio by file name in the music app on iOS 5?

share|improve this question
    
Have you tried setting the track number in iTunes and then syncing again? –  Loïc Wolff Dec 30 '11 at 15:16
    
No, I haven't. Put that as an answer and if it works I'll accept it. –  Kalamane Dec 30 '11 at 15:17
    
+1 For the chapter titles alone. –  Jason Salaz Dec 30 '11 at 16:34

3 Answers 3

up vote 3 down vote accepted

Have you tried setting the track number in iTunes and then syncing again?

itunes get info

share|improve this answer

While not actually answering your question, do yourself a favor and select all the files for your audio book, Right-click one of them and choose 'Get Info' opening a dialog, similar to that in Loïc Wolff's answer;

Click the 'Options' category, and change the Media Kind to 'Audiobook'.

Only when something is classified as an Audiobook will you get features such as resuming mid-file. Music will always start from the beginning when you re-select it.

iTunes Get Info Dialog, Choosing Audiobook as Media Kind

share|improve this answer
    
This is great advice, thank you. –  Kalamane Dec 30 '11 at 16:41

I was frustrated by this as well and ended up writing a simple script for just this task using Ruby (which comes pre-installed on MacOS and is available on all OSes) with the taglib library. If you're a little programming savvy, just plug in the directory where the files are into the "mydir" variable and save this script (say as "rename_audio_title_to_filename.rb" ). After running it, the filenames will match the title tag and when you drag them them into Itunes playlists, they will be sorted correctly. You can also change the mp3 to other file formats that are supported.

#! /usr/bin/env ruby

require 'taglib'

mydir = "/path/to/my/audio/files"

Dir.glob "#{mydir}/*mp3" do |filename|
  TagLib::FileRef.open( filename ) do |fileref|
    tag = fileref.tag

    puts "The title is #{tag.title} and will become #{File.basename(filename)}"
    tag.title =  File.basename(filename)
    fileref.save
  end

end

Then just run it:

ruby rename_audio_title_to_filename.rb
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.