audio 2 subject:t0934 / multimedia programming foundation session:9 tahun:2009 versi:1/0
TRANSCRIPT
Audio 2
Subject : T0934 / Multimedia Programming FoundationSession : 9Tahun : 2009Versi : 1/0
Bina Nusantara
Learning Outcomes
In the end of this session, students must be able to: – Understand the basic principal
of audio format and compression
– Apply Java Sound API syntax to manipulate basic audio properties
Outline
• Audio Coding• Audio Compression• Java Sound API
Bina Nusantara
PCM
• PCM (Pulse Code Modulation) quantized sample output– Differences versions is called DPCM – Much-simplified version of DPCM is called DM (Delta
Modulation– Adaptive version is called ADPCM
• PCM encodings – Linear quantization – Non-linear quantization
Bina Nusantara
Linear quantization
• samples are typically stored as uniformly quantized values
• Compact discs, for example, use linear PCM-encoded sound.
Bina Nusantara
Non-linear quantization
• maps the original sound's amplitude to the stored value using a nonlinear function
• Mu-law encoding and A-law encoding are common nonlinear encodings, usually used for telephony or recordings of speech.
Bina Nusantara
PCM Coding Process
Bina Nusantara
Input analog signal
Output analog signal
• Bandlimiting filter• blocks out very low and high frequencies
• Low-pass filter• allows only frequencies up to the original signal to
be retained
• Bandlimiting filter• blocks out very low and high frequencies
• Low-pass filter• allows only frequencies up to the original signal to
be retained
WAVE format
Bina Nusantara
• The WAVE file format uses Microsoft's RIFF (Resource Interchange File Format) standard for the storage of multimedia files.
• A RIFF file starts out with a file header followed by a sequence of data chunks.
RIFF header chunk
RIFF header chunk fmt chunkfmt chunk data chunkdata chunk
identifies the file as a WAV file
describes the sound data's format such as :
• type of compression• number of channels• sample rate• bits per sample• other attributes
contains the size of the data and
the actual sound
MPEG-1 audio
• Has three layers of audio compression
• The higher layers, the better compression
Bina Nusantara
MPEG-1 audio Format
Bina Nusantara
• Synchronization code
• Sampling rate• Bitrate• Stereo information
HeaderHeader SBS FormatSBS Format SBS(subband-samples)
SBS(subband-samples)
Ancillary data(extra information)Ancillary data
(extra information)
• Multilingual data• Surround-sound
data
MPEG-2/4/7
• MPEG-2– Standard for DVD– MPEG-2 Advanced Audio Coding (AAC) can have five
channels (5.1 channel systems)
• MPEG-4– Integrates several different audio components into one
standard– Audio components include speech compression, text-to-
speech, and MIDI
• MPEG-7– Promotes ease of search for audio objects– Supports ASR (Automatic Speech Recognition)
application
Bina Nusantara
Java Sound API
• Play and stop sampled audio• Volume up and down• Right and left channel balance• Play and stop MIDI
Bina Nusantara
Sound Property
Bina Nusantara
- Get durationMidi File
Sampled Sound File
- Get Audio Format
- Get duration
- Get Sample Rate
- Get Channels
Sample Code
Bina Nusantara
To Play Sampled Sound
To Control Volume and Balance Sampled Sound
To Play Midi
Sample Code
Bina Nusantara
Create JSlider to control Balance and Volume Sampled Sound
Sample Code
Bina Nusantara
Result
References
• WAVE PCM soundfile format. 2003. http://ccrma.stanford.edu/courses/422/projects/WaveFormat/
• WAV File Format. 2009. http://technology.niagarac.on.ca/courses/ctec1631/WavFileFormat.html
• The Java Sound API. 2009. http://onjava.com/onjava/excerpt/jenut3_ch17/
• MP3. 2009. http://en.wikipedia.org/wiki/MP3• WAV. 2009. http://en.wikipedia.org/wiki/WAV
Bina Nusantara