230 likes | 408 Views
Digital Audio Storage Formats. Formats. There are many different formats for storing and communicating digital audio: CD audio Wav Aiff Au MP3. WAVE. Waveform Audio (wave or .wav ) is a file format in which Windows stores sounds as waveforms
E N D
Formats • There are many different formats for storing and communicating digital audio: • CD audio • Wav • Aiff • Au • MP3
WAVE • Waveform Audio (wave or .wav) is a file format in which Windows stores sounds as waveforms • The WAVE format is a subset of RIFF (Resource Interchange File Format) used for storing digital audio • Basic .wav files store information in PCM format with no compression
.wav • Wave files contain 3 parts: • Descriptor • Format information • Data
Chunk Descriptor • ChunkID - Contains the letters “RIFF” in ASCII form • ChunkSize - This is the size of the entire file in bytes minus 8 bytes for the two fields not included in this count: ChunkID and ChunkSize • Format - Contains the letters “WAVE” in ASCII from
Format Sub-chunk • Subchunk1ID - Contains the letters “fmt” • Subchunk1Size - 16 for PCM. This is the size of the rest of the sub-chunk which follows this number • AudioFormat - PCM = 1 (i.e. Linear quantization). Values other than 1 indicate some form of compression • ByteRate - SampleRate * NumChannels * BitsPerSample / 8 • BlockAlign - NumChannels * BitsPerSample / 8 The number of bytes for one sample
Data Sub-chunk • Subchunk2ID - Contains the letters “data” • Subchunk2Size– • NumSamples * NumChannels * BitsPerSample / 8 • This is the number of bytes in the data • Data - The actual PCM sound data • 8-bit samples are stored as unsigned bytes, ranging from 0 to 255. 16-bit samples are stored as 2’s-complement signed integers, ranging from -32768 to 32767
.au • Sun’s audio file format • File is composed of three parts: • 24-byte header • variable-length annotation block • contiguous segment of audio data
Header Information • Magic Number- 4 bytes - “.snd” • hdr_size - 4 bytes - offset to start of audio data • data_size- 4 bytes - data length, in bytes (optional) • encoding- data encoding type code • sample_rate- samples per second • channels- number of interleaved channels
AIFF • Apple’s Audio Interchange File Format • RIFF (and thus .wav) is derived from AIFF • File is split into: • Header, Common and Data Chunk • ChunkID - Contains the letters “FORM" in ASCII. • ChunkSize - This is the size of the entire file in bytes minus 8 bytes for the two fields not included in this count: ChunkID and ChunkSize. • Format - Contains the letters “AIFF” • Common chunk – information on data format • Data chunk – PCM audio data
MIDI • Musical Instrument Digital Interface • Serial interface standard for interfacing between electronic instruments (31.25Kbits uni-directional) • Involves communicating sound events rather than sampled audio
MIDI • The information transmitted between MIDI devices is in a form called a MIDI message, which encodes aspects of sound such as: • note played, note number, velocity • sustain pedal, breath controllers, aftertouch, pitch bend, modulation
MIDI Message Format • Control messages are sent as groups of bytes, preceded by one start bit and followed by a stop bit
MIDI Message Format • There are two basic types of MIDI message byte • Status byte (starts with a ‘1’) • Data byte (starts with a ‘0’) 8 bits 1sssnnnn 0xxxxxxx 0yyyyyyy Status Data 1 Data 2
MIDI • There are sixteen basic MIDI channels and instruments can usually be set to receive on one (omni off) or all (omni on) • General MIDI sets the standard for the ordering and naming of sounds • Group 1-8 Piano 65-72 Reed 9-16 Chromatic Percussion 73-80 Pipe 17-24 Organ 81-88 Synth Lead 25-32 Guitar 89-96 Synth Pad 33-40 Bass 97-104 Synth FX 41-48 Strings 105-112 Ethnic Instruments 49-56 Ensemble 113-120 Percussive Instrms 57-67 Brass 121-128 Sound effects • Plus 47 percussive sounds
MIDI • Using MIDI for transferring music can be problematic • Even with general MIDI the output depends on the quality and type of synthesiser used • Not so good for Hi-Fi • Very good for multimedia or games sound effects and music
MIDI Sequencers • Capable of storing a number of “tracks” of MIDI information and manipulating them
Fin Fin