Musepack Forums  

Go Back   Musepack Forums > Main > MPC for UNIX

Reply
 
Thread Tools Search this Thread Display Modes
Old 04 June 2005, 09:55 pm   #1
George_007
Member
 
Join Date: Jun 2005
Posts: 1
Default MPC detection for magic file

Hi, it would be nice if the Linux utility 'file' could recognize mpc files and report some useful information about them. I have begun with the code below. You can add this to /etc/magic and test it with: 'file file.mpc'. I am no expert so any corrections and suggestions are welcomed.

The format is simple. First number is offset in bytes. > is additional level of tests.

Code:
# Magic local data for file(1) command.
# Insert here your local magic data. Format is described in magic(5).
0	string	   MP+	 Musepack audio data
>3	byte	   	255	\b, SV pre8   
>3	byte&0xF  	0x6	\b, SV 6
>3	byte&0xF	0x8	\b, SV 8
>3	byte&0xF  	0x7	\b, SV 7
>>3	byte&0xF0	0x0	\b.0
>>3	byte&0xF0	0x10	\b.1
>>3	byte&0xF0	240	\b.15
>>10	byte&0xF0	0x0	\b, No profile 
>>10	byte&0xF0	0x10	\b, Profile 'Unstable/Experimental'
>>10	byte&0xF0	0x50	\b, Profile 'quality 0'
>>10	byte&0xF0	0x60	\b, Profile 'quality 1'
>>10	byte&0xF0	0x70	\b, Profile 'Telephone'
>>10	byte&0xF0	0x80	\b, Profile 'Thumb'
>>10	byte&0xF0	0x90	\b, Profile 'Radio'
>>10	byte&0xF0	0xA0	\b, Profile 'Standard'
>>10	byte&0xF0	0xB0	\b, Profile 'Xtreme'
>>10	byte&0xF0	0xC0	\b, Profile 'Insane'
>>10	byte&0xF0	0xD0	\b, Profile 'BrainDead'
>>10	byte&0xF0	0xE0	\b, Profile 'quality 9'
>>10	byte&0xF0	0xF0	\b, Profile 'quality 10'
>>27	byte		0x0	\b, Buschmann 1.7.0-9, Klemm 0.90-1.05
#EncoderVersion %  2 == 1        Alpha (1.05a...z)
>>27	byte&0x1	0x1	\b (Alpha
#EncoderVersion %  2 == 0        Beta (1.06)
#EncoderVersion % 10 == 0        Release (1.0)
>>27	byte		>0
>>>27	byte&0x1	0x0	\b (Release or Beta
#Encoder version * 100
#fixme? this should be 1.06 instead of 106
>>27	byte		>0	\b v%d)
>>10	byte&0x3	0x0	\b, 44.1 kHz
>>10	byte&0x3	0x1	\b, 48 kHz
>>10	byte&0x3	0x2	\b, 37.8 kHz
>>10	byte&0x3	0x3	\b, 32 kHz
George_007 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Splitting a MPC file (with CUE sheet) pastraga General 3 23 January 2007 07:12 am
All MPC files broken after file restore deus62 MPC for Windows 3 19 August 2005 05:55 pm
low level clicks and noise davidm General 20 29 June 2005 09:05 am
How to split a mpc file? Dro77naR General 5 15 April 2005 08:48 pm
Does an mpc encoded file have replaygain info by default? drmrbrewer General 2 28 February 2005 07:12 pm


All times are GMT. The time now is 11:43 am.


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