mdls command returns null for ringtone duration

All,

When I run the mdls command on a ringtone file to fetch its duration, the output is always null. For e.g running

mdls -raw -name kMDItemDurationSeconds SomeTone.m4r on the terminal returns (null) as the output. When I check the info for the ringtone in iTunes, I see that it's 14s long. Same issue when I try to fetch the total bitrate for the ringtone using mdls. It also returns null. Why does mdls fail ?

Mac Pro, Mac OS X (10.7.3)

Posted on Apr 18, 2012 5:06 PM

Reply
2 replies

Apr 18, 2012 9:43 PM in response to red_menace

@red_menace. I force Spotlight to index the folder before running the mdls command on the ringtone.

I do mdimport "$folderName" before running the

"mdls -raw -name kMDItemDurationSeconds SomeTone.m4r"

statement. Inspite of that i get the "null" output. I ran the afinfo command on the ringtone and I was able to extract the duration. I have no idea why afinfo works and mdls doesnt

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

mdls command returns null for ringtone duration

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.