1page.title=Audio Terminology
2@jd:body
3
4<!--
5    Copyright 2014 The Android Open Source Project
6
7    Licensed under the Apache License, Version 2.0 (the "License");
8    you may not use this file except in compliance with the License.
9    You may obtain a copy of the License at
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
13    Unless required by applicable law or agreed to in writing, software
14    distributed under the License is distributed on an "AS IS" BASIS,
15    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16    See the License for the specific language governing permissions and
17    limitations under the License.
18-->
19<div id="qv-wrapper">
20  <div id="qv">
21    <h2>In this document</h2>
22    <ol id="auto-toc">
23    </ol>
24  </div>
25</div>
26
27<p>
28This document provides a glossary of audio-related terminology, including
29a list of widely used, generic terms and a list of terms that are specific
30to Android.
31</p>
32
33<h2 id="genericTerm">Generic Terms</h2>
34
35<p>
36These are audio terms that are widely used, with their conventional meanings.
37</p>
38
39<h3 id="digitalAudioTerms">Digital Audio</h3>
40
41<dl>
42
43<dt>acoustics</dt>
44<dd>
45The study of the mechanical properties of sound, for example how the
46physical placement of transducers such as speakers and microphones on
47a device affects perceived audio quality.
48</dd>
49
50<dt>attenuation</dt>
51<dd>
52A multiplicative factor less than or equal to 1.0,
53applied to an audio signal to decrease the signal level.
54Compare to "gain".
55</dd>
56
57<dt>bits per sample or bit depth</dt>
58<dd>
59Number of bits of information per sample.
60</dd>
61
62<dt>channel</dt>
63<dd>
64A single stream of audio information, usually corresponding to one
65location of recording or playback.
66</dd>
67
68<dt>downmixing</dt>
69<dd>
70To decrease the number of channels, e.g. from stereo to mono, or from 5.1 to stereo.
71This can be accomplished by dropping some channels, mixing channels, or more advanced signal processing.
72Simple mixing without attenuation or limiting has the potential for overflow and clipping.
73Compare to "upmixing".
74</dd>
75
76<dt>duck</dt>
77<dd>
78To temporarily reduce the volume of one stream, when another stream
79becomes active.  For example, if music is playing and a notification arrives,
80then the music stream could be ducked while the notification plays.
81Compare to "mute".
82</dd>
83
84<dt>frame</dt>
85<dd>
86A set of samples, one per channel, at a point in time.
87</dd>
88
89<dt>frames per buffer</dt>
90<dd>
91The number of frames handed from one module to the next at once;
92for example the audio HAL interface uses this concept.
93</dd>
94
95<dt>gain</dt>
96<dd>
97A multiplicative factor greater than or equal to 1.0,
98applied to an audio signal to increase the signal level.
99Compare to "attenuation".
100</dd>
101
102<dt>Hz</dt>
103<dd>
104The units for sample rate or frame rate.
105</dd>
106
107<dt>latency</dt>
108<dd>
109Time delay as a signal passes through a system.
110</dd>
111
112<dt>mono</dt>
113<dd>
114One channel.
115</dd>
116
117<dt>multichannel</dt>
118<dd>
119See "surround sound".
120Strictly, since stereo is more than one channel, it is also "multi" channel.
121But that usage would be confusing.
122</dd>
123
124<dt>mute</dt>
125<dd>
126To (temporarily) force volume to be zero, independently from the usual volume controls.
127</dd>
128
129<dt>PCM</dt>
130<dd>
131Pulse Code Modulation, the most common low-level encoding of digital audio.
132The audio signal is sampled at a regular interval, called the sample rate,
133and then quantized to discrete values within a particular range depending on the bit depth.
134For example, for 16-bit PCM, the sample values are integers between -32768 and +32767.
135</dd>
136
137<dt>ramp</dt>
138<dd>
139To gradually increase or decrease the level of a particular audio parameter,
140for example volume or the strength of an effect.
141A volume ramp is commonly applied when pausing and resuming music, to avoid a hard audible transition.
142</dd>
143
144<dt>sample</dt>
145<dd>
146A number representing the audio value for a single channel at a point in time.
147</dd>
148
149<dt>sample rate or frame rate</dt>
150<dd>
151Number of frames per second;
152note that "frame rate" is thus more accurate,
153but "sample rate" is conventionally used to mean "frame rate."
154</dd>
155
156<dt>sonification</dt>
157<dd>
158The use of sound to express feedback or information,
159for example touch sounds and keyboard sounds.
160</dd>
161
162<dt>stereo</dt>
163<dd>
164Two channels.
165</dd>
166
167<dt>stereo widening</dt>
168<dd>
169An effect applied to a stereo signal, to make another stereo signal which sounds fuller and richer.
170The effect can also be applied to a mono signal, in which case it is a type of upmixing.
171</dd>
172
173<dt>surround sound</dt>
174<dd>
175Various techniques for increasing the ability of a listener to perceive
176sound position beyond stereo left and right.
177</dd>
178
179<dt>upmixing</dt>
180<dd>
181To increase the number of channels, e.g. from mono to stereo, or from stereo to surround sound.
182This can be accomplished by duplication, panning, or more advanced signal processing.
183Compare to "downmixing".
184</dd>
185
186<dt>virtualizer</dt>
187<dd>
188An effect that attempts to spatialize audio channels, such as trying to
189simulate more speakers, or give the illusion that various sound sources have position.
190</dd>
191
192<dt>volume</dt>
193<dd>
194Loudness, the subjective strength of an audio signal.
195</dd>
196
197</dl>
198
199<h3 id="hardwareTerms">Hardware and Accessories</h3>
200
201<p>
202These terms are related to audio hardware and accessories.
203</p>
204
205<h4 id="interDeviceTerms">Inter-device interconnect</h4>
206
207<p>
208These technologies connect audio and video components between devices,
209and are readily visible at the external connectors.  The HAL implementor
210may need to be aware of these, as well as the end user.
211</p>
212
213<dl>
214
215<dt>Bluetooth</dt>
216<dd>
217A short range wireless technology.
218The major audio-related
219<a href="http://en.wikipedia.org/wiki/Bluetooth_profile">Bluetooth profiles</a>
220and
221<a href="http://en.wikipedia.org/wiki/Bluetooth_protocols">Bluetooth protocols</a>
222are described at these Wikipedia articles:
223
224<ul>
225
226<li><a href="http://en.wikipedia.org/wiki/Bluetooth_profile#Advanced_Audio_Distribution_Profile_.28A2DP.29">A2DP</a>
227for music
228</li>
229
230<li><a href="http://en.wikipedia.org/wiki/Bluetooth_protocols#Synchronous_connection-oriented_.28SCO.29_link">SCO</a>
231for telephony
232</li>
233
234</ul>
235
236</dd>
237
238<dt>DisplayPort</dt>
239<dd>
240Digital display interface by VESA.
241</dd>
242
243<dt>HDMI</dt>
244<dd>
245High-Definition Multimedia Interface, an interface for transferring
246audio and video data.  For mobile devices, either a micro-HDMI (type D) or MHL connector is used.
247</dd>
248
249<dt>MHL</dt>
250<dd>
251Mobile High-Definition Link is a mobile audio/video interface, often
252over micro-USB connector.
253</dd>
254
255<dt>phone connector</dt>
256<dd>
257A mini or sub-mini phone connector
258connects a device to wired headphones, headset, or line-level amplifier.
259</dd>
260
261<dt>SlimPort</dt>
262<dd>
263An adapter from micro-USB to HDMI.
264</dd>
265
266<dt>S/PDIF</dt>
267<dd>
268Sony/Philips Digital Interface Format is an interconnect for uncompressed PCM.
269See Wikipedia article <a href="http://en.wikipedia.org/wiki/S/PDIF">S/PDIF</a>.
270</dd>
271
272<dt>USB</dt>
273<dd>
274Universal Serial Bus.
275See Wikipedia article <a href="http://en.wikipedia.org/wiki/USB">USB</a>.
276</dd>
277
278</dl>
279
280<h4 id="intraDeviceTerms">Intra-device interconnect</h4>
281
282<p>
283These technologies connect internal audio components within a given
284device, and are not visible without disassembling the device.  The HAL
285implementor may need to be aware of these, but not the end user.
286</p>
287
288See these Wikipedia articles:
289<ul>
290<li><a href="http://en.wikipedia.org/wiki/General-purpose_input/output">GPIO</a></li>
291<li><a href="http://en.wikipedia.org/wiki/I%C2%B2C">I²C</a></li>
292<li><a href="http://en.wikipedia.org/wiki/I%C2%B2S">I²S</a></li>
293<li><a href="http://en.wikipedia.org/wiki/McASP">McASP</a></li>
294<li><a href="http://en.wikipedia.org/wiki/SLIMbus">SLIMbus</a></li>
295<li><a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI</a></li>
296</ul>
297
298<h3 id="signalTerms">Audio Signal Path</h3>
299
300<p>
301These terms are related to the signal path that audio data follows from
302an application to the transducer, or vice-versa.
303</p>
304
305<dl>
306
307<dt>ADC</dt>
308<dd>
309Analog to digital converter, a module that converts an analog signal
310(continuous in both time and amplitude) to a digital signal (discrete in
311both time and amplitude).  Conceptually, an ADC consists of a periodic
312sample-and-hold followed by a quantizer, although it does not have to
313be implemented that way.  An ADC is usually preceded by a low-pass filter
314to remove any high frequency components that are not representable using
315the desired sample rate.  See Wikipedia article
316<a href="http://en.wikipedia.org/wiki/Analog-to-digital_converter">Analog-to-digital_converter</a>.
317</dd>
318
319<dt>AP</dt>
320<dd>
321Application processor, the main general-purpose computer on a mobile device.
322</dd>
323
324<dt>codec</dt>
325<dd>
326Coder-decoder, a module that encodes and/or decodes an audio signal
327from one representation to another.  Typically this is analog to PCM, or PCM to analog.
328Strictly, the term "codec" is reserved for modules that both encode and decode,
329however it can also more loosely refer to only one of these.
330See Wikipedia article
331<a href="http://en.wikipedia.org/wiki/Audio_codec">Audio codec</a>.
332</dd>
333
334<dt>DAC</dt>
335<dd>
336Digital to analog converter, a module that converts a digital signal
337(discrete in both time and amplitude) to an analog signal
338(continuous in both time and amplitude).  A DAC is usually followed by
339a low-pass filter to remove any high frequency components introduced
340by digital quantization.
341See Wikipedia article
342<a href="http://en.wikipedia.org/wiki/Digital-to-analog_converter">Digital-to-analog converter</a>.
343</dd>
344
345<dt>DSP</dt>
346<dd>
347Digital Signal Processor, an optional component which is typically located
348after the application processor (for output), or before the application processor (for input).
349The primary purpose of a DSP is to off-load the application processor,
350and provide signal processing features at a lower power cost.
351</dd>
352
353<dt>PDM</dt>
354<dd>
355Pulse-density modulation
356is a form of modulation used to represent an analog signal by a digital signal,
357where the relative density of 1s versus 0s indicates the signal level.
358It is commonly used by digital to analog converters.
359See Wikipedia article
360<a href="http://en.wikipedia.org/wiki/Pulse-density_modulation">Pulse-density modulation</a>.
361</dd>
362
363<dt>PWM</dt>
364<dd>
365Pulse-width modulation
366is a form of modulation used to represent an analog signal by a digital signal,
367where the relative width of a digital pulse indicates the signal level.
368It is commonly used by analog to digital converters.
369See Wikipedia article
370<a href="http://en.wikipedia.org/wiki/Pulse-width_modulation">Pulse-width modulation</a>.
371</dd>
372
373</dl>
374
375<h3 id="srcTerms">Sample Rate Conversion</h3>
376
377<dl>
378
379<dt>downsample</dt>
380<dd>To resample, where sink sample rate &lt; source sample rate.</dd>
381
382<dt>Nyquist frequency</dt>
383<dd>
384The Nyquist frequency, equal to 1/2 of a given sample rate, is the
385maximum frequency component that can be represented by a discretized
386signal at that sample rate.  For example, the human hearing range is
387typically assumed to extend up to approximately 20 kHz, and so a digital
388audio signal must have a sample rate of at least 40 kHz to represent that
389range.  In practice, sample rates of 44.1 kHz and 48 kHz are commonly
390used, with Nyquist frequencies of 22.05 kHz and 24 kHz respectively.
391See
392<a href="http://en.wikipedia.org/wiki/Nyquist_frequency" target="_android">Nyquist frequency</a>
393and
394<a href="http://en.wikipedia.org/wiki/Hearing_range" target="_android">Hearing range</a>
395for more information.
396</dd>
397
398<dt>resampler</dt>
399<dd>Synonym for sample rate converter.</dd>
400
401<dt>resampling</dt>
402<dd>The process of converting sample rate.</dd>
403
404<dt>sample rate converter</dt>
405<dd>A module that resamples.</dd>
406
407<dt>sink</dt>
408<dd>The output of a resampler.</dd>
409
410<dt>source</dt>
411<dd>The input to a resampler.</dd>
412
413<dt>upsample</dt>
414<dd>To resample, where sink sample rate &gt; source sample rate.</dd>
415
416</dl>
417
418<h2 id="androidSpecificTerms">Android-Specific Terms</h2>
419
420<p>
421These are terms specific to the Android audio framework, or that
422may have a special meaning within Android beyond their general meaning.
423</p>
424
425<dl>
426
427<dt>ALSA</dt>
428<dd>
429Advanced Linux Sound Architecture.  As the name suggests, it is an audio
430framework primarily for Linux, but it has influenced other systems.
431See Wikipedia article
432<a href="http://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture">ALSA</a>
433for the general definition. As used within Android, it refers primarily
434to the kernel audio framework and drivers, not to the user-mode API. See
435tinyalsa.
436</dd>
437
438<dt>AudioEffect</dt>
439<dd>
440An API and implementation framework for output (post-processing) effects
441and input (pre-processing) effects.  The API is defined at
442<a href="http://developer.android.com/reference/android/media/audiofx/AudioEffect.html">android.media.audiofx.AudioEffect</a>.
443</dd>
444
445<dt>AudioFlinger</dt>
446<dd>
447The sound server implementation for Android. AudioFlinger
448runs within the mediaserver process. See Wikipedia article
449<a href="http://en.wikipedia.org/wiki/Sound_server">Sound server</a>
450for the generic definition.
451</dd>
452
453<dt>audio focus</dt>
454<dd>
455A set of APIs for managing audio interactions across multiple independent apps.
456See <a href="http://developer.android.com/training/managing-audio/audio-focus.html">Managing Audio
457Focus</a> and the focus-related methods and constants of
458<a href="http://developer.android.com/reference/android/media/AudioManager.html">android.media.AudioManager</a>.
459</dd>
460
461<dt>AudioMixer</dt>
462<dd>
463The module within AudioFlinger responsible for
464combining multiple tracks and applying attenuation
465(volume) and certain effects. The Wikipedia article
466<a href="http://en.wikipedia.org/wiki/Audio_mixing_(recorded_music)">Audio mixing (recorded music)</a>
467may be useful for understanding the generic
468concept. But that article describes a mixer more as a hardware device
469or a software application, rather than a software module within a system.
470</dd>
471
472<dt>audio policy</dt>
473<dd>
474Service responsible for all actions that require a policy decision
475to be made first, such as opening a new I/O stream, re-routing after a
476change and stream volume management.
477</dd>
478
479<dt>AudioRecord</dt>
480<dd>
481The primary low-level client API for receiving data from an audio
482input device such as microphone.  The data is usually in pulse-code modulation
483(PCM) format.
484The API is defined at
485<a href="http://developer.android.com/reference/android/media/AudioRecord.html">android.media.AudioRecord</a>.
486</dd>
487
488<dt>AudioResampler</dt>
489<dd>
490The module within AudioFlinger responsible for
491<a href="audio_src.html">sample rate conversion</a>.
492</dd>
493
494<dt>AudioTrack</dt>
495<dd>
496The primary low-level client API for sending data to an audio output
497device such as a speaker.  The data is usually in PCM format.
498The API is defined at
499<a href="http://developer.android.com/reference/android/media/AudioTrack.html">android.media.AudioTrack</a>.
500</dd>
501
502<dt>client</dt>
503<dd>
504Usually same as application or app, but sometimes the "client" of
505AudioFlinger is actually a thread running within the mediaserver system
506process. An example of that is when playing media that is decoded by a
507MediaPlayer object.
508</dd>
509
510<dt>HAL</dt>
511<dd>
512Hardware Abstraction Layer. HAL is a generic term in Android. With
513respect to audio, it is a layer between AudioFlinger and the kernel
514device driver with a C API, which replaces the earlier C++ libaudio.
515</dd>
516
517<dt>FastMixer</dt>
518<dd>
519A thread within AudioFlinger that services lower latency "fast tracks"
520and drives the primary output device.
521</dd>
522
523<dt>fast track</dt>
524<dd>
525An AudioTrack client with lower latency but fewer features, on some devices.
526</dd>
527
528<dt>MediaPlayer</dt>
529<dd>
530A higher-level client API than AudioTrack, for playing either encoded
531content, or content which includes multimedia audio and video tracks.
532</dd>
533
534<dt>media.log</dt>
535<dd>
536An AudioFlinger debugging feature, available in custom builds only,
537for logging audio events to a circular buffer where they can then be
538dumped retroactively when needed.
539</dd>
540
541<dt>mediaserver</dt>
542<dd>
543An Android system process that contains a number of media-related
544services, including AudioFlinger.
545</dd>
546
547<dt>NBAIO</dt>
548<dd>
549An abstraction for "non-blocking" audio input/output ports used within
550AudioFlinger. The name can be misleading, as some implementations of
551the NBAIO API actually do support blocking. The key implementations of
552NBAIO are for pipes of various kinds.
553</dd>
554
555<dt>normal mixer</dt>
556<dd>
557A thread within AudioFlinger that services most full-featured
558AudioTrack clients, and either directly drives an output device or feeds
559its sub-mix into FastMixer via a pipe.
560</dd>
561
562<dt>OpenSL ES</dt>
563<dd>
564An audio API standard by The Khronos Group. Android versions since
565API level 9 support a native audio API which is based on a subset of
566OpenSL ES 1.0.1.
567</dd>
568
569<dt>silent mode</dt>
570<dd>
571A user-settable feature to mute the phone ringer and notifications,
572without affecting media playback (music, videos, games) or alarms.
573</dd>
574
575<dt>SoundPool</dt>
576<dd>
577A higher-level client API than AudioTrack, used for playing sampled
578audio clips. It is useful for triggering UI feedback, game sounds, etc.
579The API is defined at
580<a href="http://developer.android.com/reference/android/media/SoundPool.html">android.media.SoundPool</a>.
581</dd>
582
583<dt>Stagefright</dt>
584<dd>
585See <a href="{@docRoot}devices/media.html">Media</a>.
586</dd>
587
588<dt>StateQueue</dt>
589<dd>
590A module within AudioFlinger responsible for synchronizing state
591among threads. Whereas NBAIO is used to pass data, StateQueue is used
592to pass control information.
593</dd>
594
595<dt>strategy</dt>
596<dd>
597A grouping of stream types with similar behavior, used by the audio policy service.
598</dd>
599
600<dt>stream type</dt>
601<dd>
602An enumeration that expresses a use case for audio output.
603The audio policy implementation uses the stream type, along with other parameters,
604to determine volume and routing decisions.
605Specific stream types are listed at
606<a href="http://developer.android.com/reference/android/media/AudioManager.html">android.media.AudioManager</a>.
607</dd>
608
609<dt>tee sink</dt>
610<dd>
611See the separate article on tee sink in
612<a href="audio_debugging.html#teeSink">Audio Debugging</a>.
613</dd>
614
615<dt>tinyalsa</dt>
616<dd>
617A small user-mode API above ALSA kernel with BSD license, recommended
618for use in HAL implementations.
619</dd>
620
621<dt>ToneGenerator</dt>
622<dd>
623A higher-level client API than AudioTrack, used for playing DTMF signals.
624See the Wikipedia article
625<a href="http://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling">Dual-tone multi-frequency signaling</a>,
626and the API definition at
627<a href="http://developer.android.com/reference/android/media/ToneGenerator.html">android.media.ToneGenerator</a>.
628</dd>
629
630<dt>track</dt>
631<dd>
632An audio stream, controlled by the AudioTrack API.
633</dd>
634
635<dt>volume attenuation curve</dt>
636<dd>
637A device-specific mapping from a generic volume index to a particular attenuation factor
638for a given output.
639</dd>
640
641<dt>volume index</dt>
642<dd>
643A unitless integer that expresses the desired relative volume of a stream.
644The volume-related APIs of
645<a href="http://developer.android.com/reference/android/media/AudioManager.html">android.media.AudioManager</a>
646operate in volume indices rather than absolute attenuation factors.
647</dd>
648
649</dl>
650