140 likes | 291 Views
Sound. Sound Sampling Basics. Common Sampling Rates 8KHz (Phone) or 8.012820513kHz (Phone, NeXT) 11.025kHz (1/4 CD std) 16kHz (G.722 std) 22.05kHz (1/2 CD std) 44.1kHz (CD, DAT) 48kHz (DAT) Bits per Sample 8 or 16 Number of Channels mono/stereo/quad/ etc. Common Sound File Formats.
E N D
Sound Sampling Basics • Common Sampling Rates • 8KHz (Phone) or 8.012820513kHz (Phone, NeXT) • 11.025kHz (1/4 CD std) • 16kHz (G.722 std) • 22.05kHz (1/2 CD std) • 44.1kHz (CD, DAT) • 48kHz (DAT) • Bits per Sample • 8 or 16 • Number of Channels • mono/stereo/quad/ etc.
Common Sound File Formats • Mulaw (Sun, NeXT) .au • RIFF Wave (MS WAV) .wav • MPEG Audio Layer (MPEG) .mp2 .mp3 • AIFC (Apple, SGI) .aiff .aif • HCOM (Mac) .hcom • SND (Sun, NeXT) .snd • VOC (Soundblaster card proprietary standard) .voc • AND MANY OTHERS!
What’s in a Sound File Format • Header Information • Magic Cookie • Sampling Rate • Bits/Sample • Channels • Byte Order • Endian • Compression type • Data
Example File Format (NIST SPHERE) NIST_1A 1024 sample_rate -i 16000 channel_count -i 1 sample_n_bytes -i 2 sample_byte_format -s2 10 sample_sig_bits -i 16 sample_count -i 594400 sample_coding -s3 pcm sample_checksum -i 20129 end_head
A collection of data chunks. Each chunk has a 32-bit Id followed by a 32-bit chunk length followed by the chunk data. 0x00 chunk id 'RIFF' 0x04 chunk size (32-bits) 0x08 wave chunk id 'WAVE' 0x0C format chunk id 'fmt ' 0x10 format chunk size (32-bits) 0x14 format tag (currently pcm) 0x16 number of channels 1=mono, 2=stereo 0x18 sample rate in hz 0x1C average bytes per second 0x20 number of bytes per sample 1 = 8-bit mono 2 = 8-bit stereo or 16-bit mono 4 = 16-bit stereo 0x22 number of bits in a sample 0x24 data chunk id 'data' 0x28 length of data chunk (32-bits) 0x2C Sample data WAVe file format (Microsoft) RIFF
Mu-Law u-LAW (or mu-LAW) is sgn(x) y= -------- ln( 1+ u |x|) ln(1+u) u=100 or 255, A=87.6, mp = Peak message value,
Compression u-LAW sihttp://shuttle.nasa.gov/askmcc/answers/lence detection ADPCM (adaptive, delta PCM, 24/32/40 kbps) LPC-10E (Linear Predictive Coding 2.4kb/s) CELP 4.8Kb/s - builds on LPC GSM (European Cell Phones, RPE-LPC) 1650 bytes/sec (at 8000 samples/sec) RealAudio (builds on CELP, GSM, proprietary) MPEG Audio Layers (builds on ADPCM) Layer-2: From 32 kbps to 384 kbps - target bit rate of 128 kbps Layer-3: From 32 kbps to 320 kbps - target bit rate of 64 kbps Complex compression, using perceptual models
Sound Editing • GoldWave - • requires a sound card. • digital audio sound player, recorder and editor • can load, play and edit many different file formats • .wav, .au, .voc, .snd • displays separate graphics for the left and right channels • very easy to use • good sound quality • Others: WHAM, Cool Edit, SOX, WINPLANY, Digital Audio Playback Facility, MOD4Win, etc.
Tips for Audio on the Web • There is no generic audio standard on the Web • Few systems on the Web have 16-bit sound capabilities • Listening to 16-bit sounds on an 8-bit system results in strange effects • Users will be annoyed if they spend a lot of time downloading a sound and they can’t play it • Distribute only 8-bit sounds on your Web page • Or, provide different sound files in both 8- and 16-bits • Record in the highest sampling rate and size you can, and then process down to 8-bit • Keep file size small • downsampling to 8-bit • use a lower sampling rate • use mono sounds • Describe what format those sounds are in • WAVE, AIFF, or other format • Providing the file size in the description is a politeness to help estimate download times • If you need high sound quality and have large audio files: • Use a smaller sound clip in m-law format as a preview • or for those who can’t to listen to the higher-quality sample. • Check out http://www.realaudio.com/help/content/audiohints.html.
Space Requirements Storage Requirements for One Minute of Sound
References • http://www.nlc-bnc.ca/pubs/netnotes/notes24.htm • http://www.spies.com/sox (conversion tool) • http://freebsd.cdrom.com/.5/cica/sounds/gldwav21.zip
Sound That’s all for today