Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 4 down vote accepted

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

itunes get info

share|improve this answer
So it seems you have to do this manually, one file at a time.... kinda annoying.... but at least it works! :) – ClearCloud8 Oct 31 '15 at 2:56

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| filename ) do |fileref|
    tag = fileref.tag

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


Then just run it:

ruby rename_audio_title_to_filename.rb
share|improve this answer
Actually what would be cool is a script that will parse the track number from the file name and insert it as the Track Number on the metadata... – ClearCloud8 Oct 31 '15 at 2:50

Your Answer


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.