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 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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" />
<!-- qaudioformat.cpp -->
<title>Qt 4.8: QAudioFormat Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtmultimedia.html">QtMultimedia</a></li>
<li>QAudioFormat</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QAudioFormat Class Reference</h1>
<!-- $$$QAudioFormat-brief -->
<p>The QAudioFormat class stores audio parameter information. <a href="#details">More...</a></p>
<!-- @@@QAudioFormat -->
<pre class="cpp"> <span class="preprocessor">#include <QAudioFormat></span></pre><p>This class was introduced in Qt 4.6.</p>
<ul>
<li><a href="qaudioformat-members.html">List of all members, including inherited members</a></li>
<li><a href="qaudioformat-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#Endian-enum">Endian</a></b> { BigEndian, LittleEndian }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#SampleType-enum">SampleType</a></b> { Unknown, SignedInt, UnSignedInt, Float }</td></tr>
</table>
<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="qaudioformat.html#QAudioFormat">QAudioFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#QAudioFormat-2">QAudioFormat</a></b> ( const QAudioFormat & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#dtor.QAudioFormat">~QAudioFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioFormat::Endian </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#byteOrder">byteOrder</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#channelCount">channelCount</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#codec">codec</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#sampleRate">sampleRate</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#sampleSize">sampleSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioFormat::SampleType </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#sampleType">sampleType</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#setByteOrder">setByteOrder</a></b> ( QAudioFormat::Endian <i>byteOrder</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#setChannelCount">setChannelCount</a></b> ( int <i>channels</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#setCodec">setCodec</a></b> ( const QString & <i>codec</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#setSampleRate">setSampleRate</a></b> ( int <i>samplerate</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#setSampleSize">setSampleSize</a></b> ( int <i>sampleSize</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#setSampleType">setSampleType</a></b> ( QAudioFormat::SampleType <i>sampleType</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#operator-not-eq">operator!=</a></b> ( const QAudioFormat & <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioFormat & </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#operator-eq">operator=</a></b> ( const QAudioFormat & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaudioformat.html#operator-eq-eq">operator==</a></b> ( const QAudioFormat & <i>other</i> ) const</td></tr>
</table>
<a name="details"></a>
<!-- $$$QAudioFormat-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QAudioFormat class stores audio parameter information.</p>
<p>An audio format specifies how data in an audio stream is arranged, i.e, how the stream is to be interpreted. The encoding itself is specified by the <a href="qaudioformat.html#codec">codec</a>() used for the stream.</p>
<p>In addition to the encoding, QAudioFormat contains other parameters that further specify how the audio data is arranged. These are the frequency, the number of channels, the sample size, the sample type, and the byte order. The following table describes these in more detail.</p>
<table class="generic">
<thead><tr class="qt-style"><th >Parameter</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td >Sample Rate</td><td >Samples per second of audio data in Hertz.</td></tr>
<tr valign="top" class="even"><td >Number of channels</td><td >The number of audio channels (typically one for mono or two for stereo)</td></tr>
<tr valign="top" class="odd"><td >Sample size</td><td >How much data is stored in each sample (typically 8 or 16 bits)</td></tr>
<tr valign="top" class="even"><td >Sample type</td><td >Numerical representation of sample (typically signed integer, unsigned integer or float)</td></tr>
<tr valign="top" class="odd"><td >Byte order</td><td >Byte ordering of sample (typically little endian, big endian)</td></tr>
</table>
<p>You can obtain audio formats compatible with the audio device used through functions in <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a>. This class also lets you query available parameter values for a device, so that you can set the parameters yourself. See the <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a> class description for details. You need to know the format of the audio streams you wish to play. Qt does not set up formats for you.</p>
</div>
<!-- @@@QAudioFormat -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Endian$$$BigEndian$$$LittleEndian -->
<h3 class="fn"><a name="Endian-enum"></a>enum QAudioFormat::<span class="name">Endian</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QAudioFormat::BigEndian</tt></td><td class="topAlign"><tt>QSysInfo::BigEndian</tt></td><td class="topAlign">samples are big endian byte order</td></tr>
<tr><td class="topAlign"><tt>QAudioFormat::LittleEndian</tt></td><td class="topAlign"><tt>QSysInfo::LittleEndian</tt></td><td class="topAlign">samples are little endian byte order</td></tr>
</table>
<!-- @@@Endian -->
<!-- $$$SampleType$$$Unknown$$$SignedInt$$$UnSignedInt$$$Float -->
<h3 class="fn"><a name="SampleType-enum"></a>enum QAudioFormat::<span class="name">SampleType</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QAudioFormat::Unknown</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">Not Set</td></tr>
<tr><td class="topAlign"><tt>QAudioFormat::SignedInt</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">samples are signed integers</td></tr>
<tr><td class="topAlign"><tt>QAudioFormat::UnSignedInt</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">samples are unsigned intergers</td></tr>
<tr><td class="topAlign"><tt>QAudioFormat::Float</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">samples are floats</td></tr>
</table>
<!-- @@@SampleType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAudioFormat[overload1]$$$QAudioFormat -->
<h3 class="fn"><a name="QAudioFormat"></a>QAudioFormat::<span class="name">QAudioFormat</span> ()</h3>
<p>Construct a new audio format.</p>
<p>Values are initialized as follows:</p>
<ul>
<li><a href="qaudioformat.html#sampleRate">sampleRate</a>() = -1</li>
<li><a href="qaudioformat.html#channelCount">channelCount</a>() = -1</li>
<li><a href="qaudioformat.html#sampleSize">sampleSize</a>() = -1</li>
<li><a href="qaudioformat.html#byteOrder">byteOrder</a>() = <a href="qaudioformat.html#Endian-enum">QAudioFormat::Endian</a>(<a href="qsysinfo.html#Endian-enum">QSysInfo::ByteOrder</a>)</li>
<li><a href="qaudioformat.html#sampleType">sampleType</a>() = <a href="qaudioformat.html#SampleType-enum">QAudioFormat::Unknown</a> <tt>codec()</tt> = ""</li>
</ul>
<!-- @@@QAudioFormat -->
<!-- $$$QAudioFormat$$$QAudioFormatconstQAudioFormat& -->
<h3 class="fn"><a name="QAudioFormat-2"></a>QAudioFormat::<span class="name">QAudioFormat</span> ( const <span class="type">QAudioFormat</span> & <i>other</i> )</h3>
<p>Construct a new audio format using <i>other</i>.</p>
<!-- @@@QAudioFormat -->
<!-- $$$~QAudioFormat[overload1]$$$~QAudioFormat -->
<h3 class="fn"><a name="dtor.QAudioFormat"></a>QAudioFormat::<span class="name">~QAudioFormat</span> ()</h3>
<p>Destroy this audio format.</p>
<!-- @@@~QAudioFormat -->
<!-- $$$byteOrder[overload1]$$$byteOrder -->
<h3 class="fn"><a name="byteOrder"></a><span class="type"><a href="qaudioformat.html#Endian-enum">QAudioFormat::Endian</a></span> QAudioFormat::<span class="name">byteOrder</span> () const</h3>
<p>Returns the current byteOrder value.</p>
<p><b>See also </b><a href="qaudioformat.html#setByteOrder">setByteOrder</a>().</p>
<!-- @@@byteOrder -->
<!-- $$$channelCount[overload1]$$$channelCount -->
<h3 class="fn"><a name="channelCount"></a><span class="type">int</span> QAudioFormat::<span class="name">channelCount</span> () const</h3>
<p>Returns the current channel count value.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qaudioformat.html#setChannelCount">setChannelCount</a>().</p>
<!-- @@@channelCount -->
<!-- $$$codec[overload1]$$$codec -->
<h3 class="fn"><a name="codec"></a><span class="type"><a href="qstring.html">QString</a></span> QAudioFormat::<span class="name">codec</span> () const</h3>
<p>Returns the current codec value.</p>
<p><b>See also </b><a href="qaudioformat.html#setCodec">setCodec</a>() and <a href="qaudiodeviceinfo.html#supportedCodecs">QAudioDeviceInfo::supportedCodecs</a>().</p>
<!-- @@@codec -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QAudioFormat::<span class="name">isValid</span> () const</h3>
<p>Returns true if all of the parameters are valid.</p>
<!-- @@@isValid -->
<!-- $$$sampleRate[overload1]$$$sampleRate -->
<h3 class="fn"><a name="sampleRate"></a><span class="type">int</span> QAudioFormat::<span class="name">sampleRate</span> () const</h3>
<p>Returns the current sample rate in Hertz.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qaudioformat.html#setSampleRate">setSampleRate</a>().</p>
<!-- @@@sampleRate -->
<!-- $$$sampleSize[overload1]$$$sampleSize -->
<h3 class="fn"><a name="sampleSize"></a><span class="type">int</span> QAudioFormat::<span class="name">sampleSize</span> () const</h3>
<p>Returns the current sample size value.</p>
<p><b>See also </b><a href="qaudioformat.html#setSampleSize">setSampleSize</a>().</p>
<!-- @@@sampleSize -->
<!-- $$$sampleType[overload1]$$$sampleType -->
<h3 class="fn"><a name="sampleType"></a><span class="type"><a href="qaudioformat.html#SampleType-enum">QAudioFormat::SampleType</a></span> QAudioFormat::<span class="name">sampleType</span> () const</h3>
<p>Returns the current <a href="qaudioformat.html#SampleType-enum">SampleType</a> value.</p>
<p><b>See also </b><a href="qaudioformat.html#setSampleType">setSampleType</a>().</p>
<!-- @@@sampleType -->
<!-- $$$setByteOrder[overload1]$$$setByteOrderQAudioFormat::Endian -->
<h3 class="fn"><a name="setByteOrder"></a><span class="type">void</span> QAudioFormat::<span class="name">setByteOrder</span> ( <span class="type"><a href="qaudioformat.html#Endian-enum">QAudioFormat::Endian</a></span> <i>byteOrder</i> )</h3>
<p>Sets the byteOrder to <i>byteOrder</i>.</p>
<p><b>See also </b><a href="qaudioformat.html#byteOrder">byteOrder</a>().</p>
<!-- @@@setByteOrder -->
<!-- $$$setChannelCount[overload1]$$$setChannelCountint -->
<h3 class="fn"><a name="setChannelCount"></a><span class="type">void</span> QAudioFormat::<span class="name">setChannelCount</span> ( <span class="type">int</span> <i>channels</i> )</h3>
<p>Sets the channel count to <i>channels</i>.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qaudioformat.html#channelCount">channelCount</a>().</p>
<!-- @@@setChannelCount -->
<!-- $$$setCodec[overload1]$$$setCodecconstQString& -->
<h3 class="fn"><a name="setCodec"></a><span class="type">void</span> QAudioFormat::<span class="name">setCodec</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>codec</i> )</h3>
<p>Sets the codec to <i>codec</i>.</p>
<p><b>See also </b><a href="qaudioformat.html#codec">codec</a>() and <a href="qaudiodeviceinfo.html#supportedCodecs">QAudioDeviceInfo::supportedCodecs</a>().</p>
<!-- @@@setCodec -->
<!-- $$$setSampleRate[overload1]$$$setSampleRateint -->
<h3 class="fn"><a name="setSampleRate"></a><span class="type">void</span> QAudioFormat::<span class="name">setSampleRate</span> ( <span class="type">int</span> <i>samplerate</i> )</h3>
<p>Sets the sample rate to <i>samplerate</i> Hertz.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qaudioformat.html#sampleRate">sampleRate</a>().</p>
<!-- @@@setSampleRate -->
<!-- $$$setSampleSize[overload1]$$$setSampleSizeint -->
<h3 class="fn"><a name="setSampleSize"></a><span class="type">void</span> QAudioFormat::<span class="name">setSampleSize</span> ( <span class="type">int</span> <i>sampleSize</i> )</h3>
<p>Sets the sample size to the <i>sampleSize</i> specified.</p>
<p><b>See also </b><a href="qaudioformat.html#sampleSize">sampleSize</a>().</p>
<!-- @@@setSampleSize -->
<!-- $$$setSampleType[overload1]$$$setSampleTypeQAudioFormat::SampleType -->
<h3 class="fn"><a name="setSampleType"></a><span class="type">void</span> QAudioFormat::<span class="name">setSampleType</span> ( <span class="type"><a href="qaudioformat.html#SampleType-enum">QAudioFormat::SampleType</a></span> <i>sampleType</i> )</h3>
<p>Sets the sampleType to <i>sampleType</i>.</p>
<p><b>See also </b><a href="qaudioformat.html#sampleType">sampleType</a>().</p>
<!-- @@@setSampleType -->
<!-- $$$operator!=[overload1]$$$operator!=constQAudioFormat& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QAudioFormat::<span class="name">operator!=</span> ( const <span class="type">QAudioFormat</span> & <i>other</i> ) const</h3>
<p>Returns true if this <a href="qaudioformat.html">QAudioFormat</a> is not equal to the <i>other</i> <a href="qaudioformat.html">QAudioFormat</a>; otherwise returns false.</p>
<p>All elements of <a href="qaudioformat.html">QAudioFormat</a> are used for the comparison.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQAudioFormat& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QAudioFormat</span> & QAudioFormat::<span class="name">operator=</span> ( const <span class="type">QAudioFormat</span> & <i>other</i> )</h3>
<p>Assigns <i>other</i> to this <a href="qaudioformat.html">QAudioFormat</a> implementation.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQAudioFormat& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QAudioFormat::<span class="name">operator==</span> ( const <span class="type">QAudioFormat</span> & <i>other</i> ) const</h3>
<p>Returns true if this <a href="qaudioformat.html">QAudioFormat</a> is equal to the <i>other</i> <a href="qaudioformat.html">QAudioFormat</a>; otherwise returns false.</p>
<p>All elements of <a href="qaudioformat.html">QAudioFormat</a> are used for the comparison.</p>
<!-- @@@operator== -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
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.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|