This file is indexed.

/usr/share/qt5/doc/qtmultimedia/qaudiodeviceinfo.html is in qtmultimedia5-doc-html 5.2.1-0ubuntu5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qaudiodeviceinfo.cpp -->
  <title>QAudioDeviceInfo Class | QtMultimedia 5.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li>Qt 5.2</li>
<li><a href="qtmultimedia-index.html">Qt Multimedia</a></li>
<li><a href="qtmultimedia-module.html">C++ Classes</a></li>
<li>QAudioDeviceInfo</li>
<li id="buildversion">
Qt 5.2.1 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QAudioDeviceInfo Class</h1>
<!-- $$$QAudioDeviceInfo-brief -->
<p>The QAudioDeviceInfo class provides an interface to query audio devices and their functionality. <a href="#details">More...</a></p>
<!-- @@@QAudioDeviceInfo -->
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> </b><tt><span class="preprocessor">#include &lt;QAudioDeviceInfo&gt;</span>
</tt></td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> <tt>QT += multimedia</tt></td></tr></table><ul>
<li><a href="qaudiodeviceinfo-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#QAudioDeviceInfo">QAudioDeviceInfo</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#QAudioDeviceInfo-2">QAudioDeviceInfo</a></b>(const QAudioDeviceInfo &amp;<i> other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#dtor.QAudioDeviceInfo">~QAudioDeviceInfo</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#deviceName">deviceName</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#isFormatSupported">isFormatSupported</a></b>(const QAudioFormat &amp;<i> settings</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#isNull">isNull</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioFormat </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#nearestFormat">nearestFormat</a></b>(const QAudioFormat &amp;<i> settings</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioFormat </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#preferredFormat">preferredFormat</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QAudioFormat::Endian&gt; </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#supportedByteOrders">supportedByteOrders</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;int&gt; </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#supportedChannelCounts">supportedChannelCounts</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#supportedCodecs">supportedCodecs</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;int&gt; </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#supportedSampleRates">supportedSampleRates</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;int&gt; </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#supportedSampleSizes">supportedSampleSizes</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QAudioFormat::SampleType&gt; </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#supportedSampleTypes">supportedSampleTypes</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#operator-not-eq">operator!=</a></b>(const QAudioDeviceInfo &amp;<i> other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioDeviceInfo &amp; </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#operator-eq">operator=</a></b>(const QAudioDeviceInfo &amp;<i> other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#operator-eq-eq">operator==</a></b>(const QAudioDeviceInfo &amp;<i> other</i>) const</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QAudioDeviceInfo&gt; </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#availableDevices">availableDevices</a></b>(QAudio::Mode<i> mode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioDeviceInfo </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#defaultInputDevice">defaultInputDevice</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioDeviceInfo </td><td class="memItemRight bottomAlign"><b><a href="qaudiodeviceinfo.html#defaultOutputDevice">defaultOutputDevice</a></b>()</td></tr>
</table>
<a name="details"></a>
<!-- $$$QAudioDeviceInfo-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QAudioDeviceInfo class provides an interface to query audio devices and their functionality.</p>
<p>QAudioDeviceInfo lets you query for audio devices--such as sound cards and USB headsets--that are currently available on the system. The audio devices available are dependent on the platform or audio plugins installed.</p>
<p>A QAudioDeviceInfo is used by Qt to construct classes that communicate with the device--such as <a href="qaudioinput.html">QAudioInput</a>, and <a href="qaudiooutput.html">QAudioOutput</a>.</p>
<p>You can also query each device for the formats it supports. A format in this context is a set consisting of a specific byte order, channel, codec, frequency, sample rate, and sample type. A format is represented by the <a href="qaudioformat.html">QAudioFormat</a> class.</p>
<p>The values supported by the device for each of these parameters can be fetched with <a href="qaudiodeviceinfo.html#supportedByteOrders">supportedByteOrders</a>(), <a href="qaudiodeviceinfo.html#supportedChannelCounts">supportedChannelCounts</a>(), <a href="qaudiodeviceinfo.html#supportedCodecs">supportedCodecs</a>(), <a href="qaudiodeviceinfo.html#supportedSampleRates">supportedSampleRates</a>(), <a href="qaudiodeviceinfo.html#supportedSampleSizes">supportedSampleSizes</a>(), and <a href="qaudiodeviceinfo.html#supportedSampleTypes">supportedSampleTypes</a>(). The combinations supported are dependent on the platform, audio plugins installed and the audio device capabilities. If you need a specific format, you can check if the device supports it with <a href="qaudiodeviceinfo.html#isFormatSupported">isFormatSupported</a>(), or fetch a supported format that is as close as possible to the format with <a href="qaudiodeviceinfo.html#nearestFormat">nearestFormat</a>(). For instance:</p>
<pre class="cpp"><span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> format;
format<span class="operator">.</span>setSampleRate(<span class="number">44100</span>);
<span class="comment">// ... other format parameters</span>
format<span class="operator">.</span>setSampleType(<span class="type"><a href="qaudioformat.html">QAudioFormat</a></span><span class="operator">::</span>SignedInt);

<span class="type">QAudioDeviceInfo</span> info(<span class="type">QAudioDeviceInfo</span><span class="operator">::</span>defaultOutputDevice());

<span class="keyword">if</span> (<span class="operator">!</span>info<span class="operator">.</span>isFormatSupported(format))
    format <span class="operator">=</span> info<span class="operator">.</span>nearestFormat(format);</pre>
<p>The static functions <a href="qaudiodeviceinfo.html#defaultInputDevice">defaultInputDevice</a>(), <a href="qaudiodeviceinfo.html#defaultOutputDevice">defaultOutputDevice</a>(), and <a href="qaudiodeviceinfo.html#availableDevices">availableDevices</a>() let you get a list of all available devices. Devices are fetched according to the value of mode this is specified by the <a href="qaudio.html">QAudio</a>::Mode enum. The QAudioDeviceInfo returned are only valid for the <a href="qaudio.html">QAudio</a>::Mode.</p>
<p>For instance:</p>
<pre class="cpp">foreach (<span class="keyword">const</span> <span class="type">QAudioDeviceInfo</span> <span class="operator">&amp;</span>deviceInfo<span class="operator">,</span> <span class="type">QAudioDeviceInfo</span><span class="operator">::</span>availableDevices(<span class="type"><a href="qaudio.html">QAudio</a></span><span class="operator">::</span>AudioOutput))
    qDebug() <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;Device name: &quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> deviceInfo<span class="operator">.</span>deviceName();</pre>
<p>In this code sample, we loop through all devices that are able to output sound, i.e&#x2e;, play an audio stream in a supported format. For each device we find, we simply print the <a href="qaudiodeviceinfo.html#deviceName">deviceName</a>().</p>
</div>
<p><b>See also </b><a href="qaudiooutput.html">QAudioOutput</a> and <a href="qaudioinput.html">QAudioInput</a>.</p>
<!-- @@@QAudioDeviceInfo -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAudioDeviceInfo[overload1]$$$QAudioDeviceInfo -->
<h3 class="fn"><a name="QAudioDeviceInfo"></a>QAudioDeviceInfo::<span class="name">QAudioDeviceInfo</span>()</h3>
<p>Constructs an empty <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a> object.</p>
<!-- @@@QAudioDeviceInfo -->
<!-- $$$QAudioDeviceInfo$$$QAudioDeviceInfoconstQAudioDeviceInfo& -->
<h3 class="fn"><a name="QAudioDeviceInfo-2"></a>QAudioDeviceInfo::<span class="name">QAudioDeviceInfo</span>(const <span class="type">QAudioDeviceInfo</span> &amp;<i> other</i>)</h3>
<p>Constructs a copy of <i>other</i>.</p>
<!-- @@@QAudioDeviceInfo -->
<!-- $$$~QAudioDeviceInfo[overload1]$$$~QAudioDeviceInfo -->
<h3 class="fn"><a name="dtor.QAudioDeviceInfo"></a>QAudioDeviceInfo::<span class="name">~QAudioDeviceInfo</span>()</h3>
<p>Destroy this audio device info.</p>
<!-- @@@~QAudioDeviceInfo -->
<!-- $$$availableDevices[overload1]$$$availableDevicesQAudio::Mode -->
<h3 class="fn"><a name="availableDevices"></a><span class="type">QList</span>&lt;<span class="type">QAudioDeviceInfo</span>&gt; QAudioDeviceInfo::<span class="name">availableDevices</span>(<span class="type"><a href="qaudio.html#Mode-enum">QAudio::Mode</a></span><i> mode</i>)<tt> [static]</tt></h3>
<p>Returns a list of audio devices that support <i>mode</i>.</p>
<!-- @@@availableDevices -->
<!-- $$$defaultInputDevice[overload1]$$$defaultInputDevice -->
<h3 class="fn"><a name="defaultInputDevice"></a><span class="type">QAudioDeviceInfo</span> QAudioDeviceInfo::<span class="name">defaultInputDevice</span>()<tt> [static]</tt></h3>
<p>Returns the information for the default input audio device. All platform and audio plugin implementations provide a default audio device to use.</p>
<!-- @@@defaultInputDevice -->
<!-- $$$defaultOutputDevice[overload1]$$$defaultOutputDevice -->
<h3 class="fn"><a name="defaultOutputDevice"></a><span class="type">QAudioDeviceInfo</span> QAudioDeviceInfo::<span class="name">defaultOutputDevice</span>()<tt> [static]</tt></h3>
<p>Returns the information for the default output audio device. All platform and audio plugin implementations provide a default audio device to use.</p>
<!-- @@@defaultOutputDevice -->
<!-- $$$deviceName[overload1]$$$deviceName -->
<h3 class="fn"><a name="deviceName"></a><span class="type">QString</span> QAudioDeviceInfo::<span class="name">deviceName</span>() const</h3>
<p>Returns the human readable name of the audio device.</p>
<p>Device names vary depending on the platform/audio plugin being used.</p>
<p>They are a unique string identifier for the audio device.</p>
<p>eg. default, Intel, U0x46d0x9a4</p>
<!-- @@@deviceName -->
<!-- $$$isFormatSupported[overload1]$$$isFormatSupportedconstQAudioFormat& -->
<h3 class="fn"><a name="isFormatSupported"></a><span class="type">bool</span> QAudioDeviceInfo::<span class="name">isFormatSupported</span>(const <span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> &amp;<i> settings</i>) const</h3>
<p>Returns true if the supplied <i>settings</i> are supported by the audio device described by this <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a>.</p>
<!-- @@@isFormatSupported -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QAudioDeviceInfo::<span class="name">isNull</span>() const</h3>
<p>Returns whether this <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a> object holds a valid device definition.</p>
<!-- @@@isNull -->
<!-- $$$nearestFormat[overload1]$$$nearestFormatconstQAudioFormat& -->
<h3 class="fn"><a name="nearestFormat"></a><span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> QAudioDeviceInfo::<span class="name">nearestFormat</span>(const <span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> &amp;<i> settings</i>) const</h3>
<p>Returns the closest <a href="qaudioformat.html">QAudioFormat</a> to the supplied <i>settings</i> that the system supports.</p>
<p>These settings are provided by the platform/audio plugin being used.</p>
<p>They are also dependent on the <a href="qaudio.html">QAudio</a>::Mode being used.</p>
<!-- @@@nearestFormat -->
<!-- $$$preferredFormat[overload1]$$$preferredFormat -->
<h3 class="fn"><a name="preferredFormat"></a><span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> QAudioDeviceInfo::<span class="name">preferredFormat</span>() const</h3>
<p>Returns the default audio format settings for this device.</p>
<p>These settings are provided by the platform/audio plugin being used.</p>
<p>They are also dependent on the <a href="qaudio.html">QAudio</a>::Mode being used.</p>
<p>A typical audio system would provide something like:</p>
<ul>
<li>Input settings: 8000Hz mono 8 bit.</li>
<li>Output settings: 44100Hz stereo 16 bit little endian.</li>
</ul>
<!-- @@@preferredFormat -->
<!-- $$$supportedByteOrders[overload1]$$$supportedByteOrders -->
<h3 class="fn"><a name="supportedByteOrders"></a><span class="type">QList</span>&lt;<span class="type"><a href="qaudioformat.html#Endian-enum">QAudioFormat::Endian</a></span>&gt; QAudioDeviceInfo::<span class="name">supportedByteOrders</span>() const</h3>
<p>Returns a list of supported byte orders.</p>
<!-- @@@supportedByteOrders -->
<!-- $$$supportedChannelCounts[overload1]$$$supportedChannelCounts -->
<h3 class="fn"><a name="supportedChannelCounts"></a><span class="type">QList</span>&lt;<span class="type">int</span>&gt; QAudioDeviceInfo::<span class="name">supportedChannelCounts</span>() const</h3>
<p>Returns a list of supported channel counts.</p>
<p>This is typically 1 for mono sound, or 2 for stereo sound.</p>
<!-- @@@supportedChannelCounts -->
<!-- $$$supportedCodecs[overload1]$$$supportedCodecs -->
<h3 class="fn"><a name="supportedCodecs"></a><span class="type">QStringList</span> QAudioDeviceInfo::<span class="name">supportedCodecs</span>() const</h3>
<p>Returns a list of supported codecs.</p>
<p>All platform and plugin implementations should provide support for:</p>
<p>&quot;audio/pcm&quot; - Linear PCM</p>
<p>For writing plugins to support additional codecs refer to:</p>
<p>http://www.iana.org/assignments/media-types/audio/</p>
<!-- @@@supportedCodecs -->
<!-- $$$supportedSampleRates[overload1]$$$supportedSampleRates -->
<h3 class="fn"><a name="supportedSampleRates"></a><span class="type">QList</span>&lt;<span class="type">int</span>&gt; QAudioDeviceInfo::<span class="name">supportedSampleRates</span>() const</h3>
<p>Returns a list of supported sample rates (in Hertz).</p>
<!-- @@@supportedSampleRates -->
<!-- $$$supportedSampleSizes[overload1]$$$supportedSampleSizes -->
<h3 class="fn"><a name="supportedSampleSizes"></a><span class="type">QList</span>&lt;<span class="type">int</span>&gt; QAudioDeviceInfo::<span class="name">supportedSampleSizes</span>() const</h3>
<p>Returns a list of supported sample sizes (in bits).</p>
<p>Typically this will include 8 and 16 bit sample sizes.</p>
<!-- @@@supportedSampleSizes -->
<!-- $$$supportedSampleTypes[overload1]$$$supportedSampleTypes -->
<h3 class="fn"><a name="supportedSampleTypes"></a><span class="type">QList</span>&lt;<span class="type"><a href="qaudioformat.html#SampleType-enum">QAudioFormat::SampleType</a></span>&gt; QAudioDeviceInfo::<span class="name">supportedSampleTypes</span>() const</h3>
<p>Returns a list of supported sample types.</p>
<!-- @@@supportedSampleTypes -->
<!-- $$$operator!=[overload1]$$$operator!=constQAudioDeviceInfo& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QAudioDeviceInfo::<span class="name">operator!=</span>(const <span class="type">QAudioDeviceInfo</span> &amp;<i> other</i>) const</h3>
<p>Returns true if this <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a> class represents a different audio device than <i>other</i></p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQAudioDeviceInfo& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QAudioDeviceInfo</span> &amp; QAudioDeviceInfo::<span class="name">operator=</span>(const <span class="type">QAudioDeviceInfo</span> &amp;<i> other</i>)</h3>
<p>Sets the <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a> object to be equal to <i>other</i>.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQAudioDeviceInfo& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QAudioDeviceInfo::<span class="name">operator==</span>(const <span class="type">QAudioDeviceInfo</span> &amp;<i> other</i>) const</h3>
<p>Returns true if this <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a> class represents the same audio device as <i>other</i>.</p>
<!-- @@@operator== -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
   subsidiaries. Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Digia, Qt and their respective logos are trademarks of Digia Plc     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>