From shred@chessy.aworld.de Wed Aug 13 08:34:28 1997 Date: Thu, 8 Aug 97 2:49:28 GMT From: Richard Koerber To: clevy@obelix.saclay.cea.fr Subject: Re: MAUD format Hi, Laurent! > i answered Thomas Wenzel if i could supply me the specification of the MAUD > format. he answered me you are the best person to contact for this question. Yes, he's right. I wrote the multisnd.library for MacroSystem, so I know all about the MAUD standard. > can you help ? I hope so. But tomorrow I will be on vacation for two weeks. And it is pretty late now. I will write a short summary, let's hope it is enough so far. But if you have any further questions, please feel free to write back. :-) - Standard IFF format ("FORM....MAUD") - MHDR chunk construction: - mhdr_Samples *Should* be number of sample frames (consisting of one sample from *all* channels) stored in MDAT. But Samplitude stores bad data here, so this field is unreliable when loading. Better rely on the MDAT chunk length, but always save correct data! - mhdr_SampleSizeC Bits per sample stored in MDAT. The bits are really *compressed*, not filled up to byte/word. (see below) - mhdr_SampleSizeU Bits per sample after decompression. Not quite interesting, since the compression mode tells this, too. - mhdr_RateSource Rate frequency. It must be divided by mhdr_RateDevide to get the real rate in Hz! (It was not my idea to call it d_e_vide, BTW... ;) - mhdr_ChannelInfo See include file. Usually, only MCI_MONO or MCI_STEREO is used. - mhdr_Channels Number of channels (mono: 1, stereo: 2, ...) - mhdr_Compression See include file. But only MCOMP_NONE, MCOMP_ALAW and MCOMP_ULAW are used so far. Others are officially available, but I don't know one single program that saves in other compression modes. Even the multisnd.library does not support other compression modes, so you may forget about them. :-) - MDAT chunk construction: - Consists of pure audio data. There are the sample frames saved in sequence. Each one consists of one audio sample from each channel. First, there will be the left channel, then the right, then surround etc. (as selected in mhdr_Channels). - As I said: if the samples have e.g. 3 bits, they are not filled up to the next byte boundary, but they are compressed. Example (3 bit resolution, 2 channels, no compression) : -byte 1- -byte 2- -byte 3- <- MDAT chunk byte 76543210 76543210 76543210 <- bit of the byte lllrrrll lrrrlllr rrlllrrr <- channel 21021021 02102102 10210210 <- bit of the sample |--1-||---2-||---3-||--4-| <- Frame number - To the compression modes: - MCOMP_NONE: No compression is used at all. The PCM data are saved as shown above. If the sample size is *exactly* 8 bit, the samples are *unsigned*. In *all* other cases (below and above 8 bit), the samples are *signed* using 2's complement. Samples are always saved big endian. MCOMP_ALAW, MCOMP_ULAW: The appropriate (public) compression algorithm is used. Nothing very spectacular about that. - Optionally, there could also be the usual "ANNO", "AUTH" and "(C) " chunks. I also appended an include file. Hope I could help... Oh, please have a look at my SoundBox package (AmiNet, Webpage). I invented the 8SVX-Combined and the 16SV audio file format. Maybe they are from interest, too? C Ya... _ |_). _|_ _ _ _| |_/._. _|_ _ _ shred@chessy.aworld.de | \|(_| )(_|| (_| | \(_)| |_)(/_| http://www.is-koeln.de/einwohner/shred FILE: maud.i ---------------------------------- 8< --------------------------------------- IFND MAUD_I MAUD_I SET 1 ;--------------------------------------------------------------------------- ; IFND EXEC_TYPES_I ; INCLUDE "exec/types.i" ; ENDC ;--------------------------------------------------------------------------- ;---- ID's used in FORM MAUD ID_MAUD: equ 'MAUD' ;the FORM-ID ID_MHDR: equ 'MHDR' ;file header chunk ID_MDAT: equ 'MDAT' ;sample data chunk ID_MINF: equ 'MINF' ;optional channel info chunk (future) ;---- the file header 'MHDR' STRUCTURE __MaudHeader,0 ULONG mhdr_Samples ;number of samples stored in MDAT UWORD mhdr_SampleSizeC ;number of bits per sample as stored in MDAT UWORD mhdr_SampleSizeU ;number of bits per sample after decompression ULONG mhdr_RateSource ;clock source frequency (see maud.doc) UWORD mhdr_RateDevide ;clock devide (see maud.doc) UWORD mhdr_ChannelInfo ;channel information (see below) UWORD mhdr_Channels ;number of channels (mono: 1, stereo: 2, ...) UWORD mhdr_Compression ;compression type (see below) ULONG mhdr_Reserved1 ;MUST be set to 0 when saving ULONG mhdr_Reserved2 ;MUST be set to 0 when saving ULONG mhdr_Reserved3 ;MUST be set to 0 when saving LABEL mhdr_SIZEOF ;---- possible values for mhdr_ChannelInfo MCI_MONO equ 0 ;mono MCI_STEREO equ 1 ;stereo MCI_MULTIMONO equ 2 ;mono multichannel (channels can be 2, 3, 4, ...) MCI_MULTISTEREO equ 3 ;stereo multichannel (channels must be 4, 6, 8, ...) MCI_MULTICHANNEL equ 4 ;multichannel (requires additional MINF-chunks) (future) ;---- possible values for mhdr_Compression MCOMP_NONE equ 0 ;no compression MCOMP_FIBDELTA equ 1 ;'Fibonacci Delta Compression' as used in 8SVX MCOMP_ALAW equ 2 ;16->8 bit, European PCM standard A-Law MCOMP_ULAW equ 3 ;16->8 bit, American PCM standard µ-Law MCOMP_ADPCM2 equ 4 ;16->2 bit, ADPCM compression MCOMP_ADPCM3 equ 5 ;16->3 bit, ADPCM compression MCOMP_ADPCM4 equ 6 ;16->4 bit, ADPCM compression MCOMP_ADPCM5 equ 7 ;16->5 bit, ADPCM compression MCOMP_LONGDAT equ 8 ;16->12 bit, used for DAT-longplay ;--------------------------------------------------------------------------- ENDC ; MAUD_I ---------------------------------- 8< ---------------------------------------