If i enter

$ file -i music.mp3

it returns music.mp3: application/octet-stream; charset=binary

If i wipe all tags and image in this file it recognises MIME type correctly.

music.mp3: audio/mpeg; charset=binary

Is there any workaround or a bugfix? Is it possible to get correct data without modifying mp3 file?

$ file --version
file-5.03
magic file from /etc/magic:/usr/share/misc/magic
link|improve this question
Does wiping the tags and image in this file does it still play? Why do you need to worry about mime-types if it already plays ok? - Suggestion: Give us more details on how this file was created. – palhmbs Jan 31 '11 at 9:47
Yes. mp3-file without tags and album cover in it plays correctly. I need to regognise MIME-types because I use libmagic in my application to find mp3s. I don't know how files were created, but I should find a way to recognise any mp3 file correctly. – PocketSam Feb 2 '11 at 6:38
feedback

1 Answer

You can add your own rules to /etc/magic and /etc/magic.mime. See man 5 magic and the contents of /usr/share/misc/magic (or similar) for inspiration.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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