Geeks With Blogs
Woodbase Godot - Blender - .Net - C# - Game Development

If you have an IPhone, you probably know that the name in the playlist comes from the “Title”-attribute instead of the filename. Usually that is not a problem.

But when I plug my IPhone to the car stereo the tracks are sorted alphabetically by the “title”-attribute. That becomes a problem when You have an e-book where each chapter starts with “Track 01”.

You can manually update this in the file properties (from the context menu in Windows Explorer), but doing so for +200 tracks – no thank you :)

The FileInfo-class does not contain a property for this special audio file attribute. However the problem is easily solved using TagLib.

The method below, not optimized in any way - just solving the problem at hand, will set the “title”-attribute to the file name.

private static void UpdateTitleAttr(string dirPath, string fileFilter)
            var files = System.IO.Directory.GetFiles(dirPath, fileFilter);
            foreach (var file in files)
                var f = TagLib.File.Create(file);
                var newTitle = f.Name.Substring(f.Name.LastIndexOf(@"\") + 1);
                f.Tag.Title = newTitle;

So now I can hear e-books while driving :P

Posted on Friday, June 8, 2012 9:40 AM | Back to top

Comments on this post: IPhone track title

# re: IPhone track title
Requesting Gravatar...
Thanks for sharing such brilliant idea. I'll definitely, use this process on my device. - Morgan Exteriors
Left by Mike Kline on Dec 10, 2016 3:04 AM

Your comment:
 (will show your gravatar)

Copyright © woodbase | Powered by: