Musepack Forums

Musepack Forums (https://forum.musepack.net/index.php)
-   Tech (https://forum.musepack.net/forumdisplay.php?f=7)
-   -   How to identify MPC or APE audio files? (https://forum.musepack.net/showthread.php?t=391)

David1105 12 September 2007 09:40 pm

How to identify MPC or APE audio files?
 
I use the follow method to identify a MPC audio file

// MPC identifying characters MPC or MP+ (older version)
if ((s[0] == 'M' && s[1] == 'P' && s[2] == '+') || (s[0] == 'M' && s[1] == 'P' && s[2] == 'C'))
inputformat = InputFormat.MPC;

and use this method to identify APE file:

// APE identifying characters Hex: 4D 41 43 20 (ASCII: MAC)
if ((s[0] == 'M' && s[1] == 'A' && s[2] == 'C') )
inputformat = InputFormat.APE;

Please confirm if there's any problem with such soltuions?

Thanks!

Antonski 13 September 2007 11:32 pm

I believe it's much more reliable to use the file header instead of file name extension.
~

David1105 13 September 2007 11:35 pm

Quote:

Originally Posted by Antonski (Post 1638)
I believe it's much more reliable to use the file header instead of file name extension.
~

I was trying not to use file extension in my original post...

By the way, .MFC and .APE are the only file extensions for these two types of audio files? Is there any others?

r2d 23 September 2007 02:22 pm

as you can see here :
http://trac.musepack.net/trac/wiki/SV8Specification
the new musepack file format starts with 'MPCK'

and from here :
http://trac.musepack.net/trac/wiki/SV7Specification
musepack files start with 'MP+' and not 'MPC'

Nicolas


All times are GMT. The time now is 01:56 am.

Powered by vBulletin® Version 3.8.11 Beta 2
Copyright ©2000 - 2020, vBulletin Solutions Inc.