/usr/share/qt5/doc/qtmultimedia/qaudiobuffer.html is in qtmultimedia5-doc-html 5.9.5-0ubuntu1.
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 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 240 241 242 243 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qaudiobuffer.cpp -->
<title>QAudioBuffer Class | Qt Multimedia 5.9</title>
<link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
<script type="text/javascript">
document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
// loading style sheet breaks anchors that were jumped to before
// so force jumping to anchor again
setTimeout(function() {
var anchor = location.hash;
// need to jump to different anchor first (e.g. none)
location.hash = "#";
setTimeout(function() {
location.hash = anchor;
}, 0);
}, 0);
</script>
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<table><tr>
<td >Qt 5.9</td><td ><a href="qtmultimedia-index.html">Qt Multimedia</a></td><td ><a href="qtmultimedia-modules.html">C++ Classes</a></td><td >QAudioBuffer</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.5 Reference Documentation</td>
</tr></table>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<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>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QAudioBuffer Class</h1>
<!-- $$$QAudioBuffer-brief -->
<p>The <a href="qaudiobuffer.html">QAudioBuffer</a> class represents a collection of audio samples with a specific format and sample rate. <a href="#details">More...</a></p>
<!-- @@@QAudioBuffer -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QAudioBuffer></span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += multimedia</td></tr></table></div><ul>
<li><a href="qaudiobuffer-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer-stereoframe.html">StereoFrame</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer-stereoframe.html#S16S-typedef">S16S</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer-stereoframe.html#S16U-typedef">S16U</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer-stereoframe.html#S32F-typedef">S32F</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer-stereoframe.html#S8S-typedef">S8S</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer-stereoframe.html#S8U-typedef">S8U</a></b></td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#QAudioBuffer">QAudioBuffer</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#QAudioBuffer-2">QAudioBuffer</a></b>(const QAudioBuffer &<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#QAudioBuffer-3">QAudioBuffer</a></b>(const QByteArray &<i>data</i>, const QAudioFormat &<i>format</i>, qint64 <i>startTime</i> = -1)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#QAudioBuffer-4">QAudioBuffer</a></b>(int <i>numFrames</i>, const QAudioFormat &<i>format</i>, qint64 <i>startTime</i> = -1)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#dtor.QAudioBuffer">~QAudioBuffer</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#byteCount">byteCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const void *</td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#constData">constData</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const T *</td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#constData-1">constData</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const void *</td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#data">data</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void *</td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#data-1">data</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const T *</td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#data-2">data</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T *</td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#data-3">data</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#duration">duration</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioFormat </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#format">format</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#frameCount">frameCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#isValid">isValid</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#sampleCount">sampleCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#startTime">startTime</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioBuffer &</td><td class="memItemRight bottomAlign"><b><a href="qaudiobuffer.html#operator-eq">operator=</a></b>(const QAudioBuffer &<i>other</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QAudioBuffer-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qaudiobuffer.html">QAudioBuffer</a> class represents a collection of audio samples with a specific format and sample rate.</p>
</div>
<!-- @@@QAudioBuffer -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$S16S -->
<h3 class="fn" id="S16S-typedef"><a name="S16S-typedef"></a>typedef QAudioBuffer::<span class="name">S16S</span></h3>
<p>This is a predefined specialization for a signed stereo 16 bit sample. Each channel is a <i>signed short</i>.</p>
<!-- @@@S16S -->
<!-- $$$S16U -->
<h3 class="fn" id="S16U-typedef"><a name="S16U-typedef"></a>typedef QAudioBuffer::<span class="name">S16U</span></h3>
<p>This is a predefined specialization for an unsigned stereo 16 bit sample. Each channel is an <i>unsigned short</i>.</p>
<!-- @@@S16U -->
<!-- $$$S32F -->
<h3 class="fn" id="S32F-typedef"><a name="S32F-typedef"></a>typedef QAudioBuffer::<span class="name">S32F</span></h3>
<p>This is a predefined specialization for an 32 bit float sample. Each channel is a <i>float</i>.</p>
<!-- @@@S32F -->
<!-- $$$S8S -->
<h3 class="fn" id="S8S-typedef"><a name="S8S-typedef"></a>typedef QAudioBuffer::<span class="name">S8S</span></h3>
<p>This is a predefined specialization for a signed stereo 8 bit sample. Each channel is a <i>signed char</i>.</p>
<!-- @@@S8S -->
<!-- $$$S8U -->
<h3 class="fn" id="S8U-typedef"><a name="S8U-typedef"></a>typedef QAudioBuffer::<span class="name">S8U</span></h3>
<p>This is a predefined specialization for an unsigned stereo 8 bit sample. Each channel is an <i>unsigned char</i>.</p>
<!-- @@@S8U -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAudioBuffer[overload1]$$$QAudioBuffer -->
<h3 class="fn" id="QAudioBuffer"><a name="QAudioBuffer"></a>QAudioBuffer::<span class="name">QAudioBuffer</span>()</h3>
<p>Create a new, empty, invalid buffer.</p>
<!-- @@@QAudioBuffer -->
<!-- $$$QAudioBuffer$$$QAudioBufferconstQAudioBuffer& -->
<h3 class="fn" id="QAudioBuffer-2"><a name="QAudioBuffer-2"></a>QAudioBuffer::<span class="name">QAudioBuffer</span>(const <span class="type"><a href="qaudiobuffer.html#QAudioBuffer">QAudioBuffer</a></span> &<i>other</i>)</h3>
<p>Creates a new audio buffer from <i>other</i>. Generally this will have copy-on-write semantics - a copy will only be made when it has to be.</p>
<!-- @@@QAudioBuffer -->
<!-- $$$QAudioBuffer$$$QAudioBufferconstQByteArray&constQAudioFormat&qint64 -->
<h3 class="fn" id="QAudioBuffer-3"><a name="QAudioBuffer-3"></a>QAudioBuffer::<span class="name">QAudioBuffer</span>(const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &<i>data</i>, const <span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> &<i>format</i>, <span class="type"><a href="../qtcore/qtglobal.html#qint64-typedef">qint64</a></span> <i>startTime</i> = -1)</h3>
<p>Creates a new audio buffer from the supplied <i>data</i>, in the given <i>format</i>. The format will determine how the number and sizes of the samples are interpreted from the <i>data</i>.</p>
<p>If the supplied <i>data</i> is not an integer multiple of the calculated frame size, the excess data will not be used.</p>
<p>This audio buffer will copy the contents of <i>data</i>.</p>
<p><i>startTime</i> (in microseconds) indicates when this buffer starts in the stream. If this buffer is not part of a stream, set it to -1.</p>
<!-- @@@QAudioBuffer -->
<!-- $$$QAudioBuffer$$$QAudioBufferintconstQAudioFormat&qint64 -->
<h3 class="fn" id="QAudioBuffer-4"><a name="QAudioBuffer-4"></a>QAudioBuffer::<span class="name">QAudioBuffer</span>(<span class="type">int</span> <i>numFrames</i>, const <span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> &<i>format</i>, <span class="type"><a href="../qtcore/qtglobal.html#qint64-typedef">qint64</a></span> <i>startTime</i> = -1)</h3>
<p>Creates a new audio buffer with space for <i>numFrames</i> frames of the given <i>format</i>. The individual samples will be initialized to the default for the format.</p>
<p><i>startTime</i> (in microseconds) indicates when this buffer starts in the stream. If this buffer is not part of a stream, set it to -1.</p>
<!-- @@@QAudioBuffer -->
<!-- $$$~QAudioBuffer[overload1]$$$~QAudioBuffer -->
<h3 class="fn" id="dtor.QAudioBuffer"><a name="dtor.QAudioBuffer"></a>QAudioBuffer::<span class="name">~QAudioBuffer</span>()</h3>
<p>Destroys this audio buffer.</p>
<!-- @@@~QAudioBuffer -->
<!-- $$$byteCount[overload1]$$$byteCount -->
<h3 class="fn" id="byteCount"><a name="byteCount"></a><span class="type">int</span> QAudioBuffer::<span class="name">byteCount</span>() const</h3>
<p>Returns the size of this buffer, in bytes.</p>
<!-- @@@byteCount -->
<!-- $$$constData[overload1]$$$constData -->
<h3 class="fn" id="constData"><a name="constData"></a>const <span class="type">void</span> *QAudioBuffer::<span class="name">constData</span>() const</h3>
<p>Returns a pointer to this buffer's data. You can only read it.</p>
<p>This method is preferred over the const version of <a href="qaudiobuffer.html#data">data</a>() to prevent unnecessary copying.</p>
<p>There is also a templatized version of this constData() function that allows you to retrieve a specific type of read-only pointer to the data. Note that there is no checking done on the format of the audio buffer - this is simply a convenience function.</p>
<pre class="cpp">
<span class="comment">// With a 16bit sample buffer:</span>
<span class="keyword">const</span> <span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> <span class="operator">*</span>data <span class="operator">=</span> buffer<span class="operator">-</span><span class="operator">></span>constData<span class="operator"><</span><span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span><span class="operator">></span>();
</pre>
<!-- @@@constData -->
<!-- $$$constData$$$constData -->
<h3 class="fn" id="constData-1"><a name="constData-1"></a>const <span class="type">T</span> *QAudioBuffer::<span class="name">constData</span>() const</h3>
<!-- @@@constData -->
<!-- $$$data[overload1]$$$data -->
<h3 class="fn" id="data"><a name="data"></a>const <span class="type">void</span> *QAudioBuffer::<span class="name">data</span>() const</h3>
<p>Returns a pointer to this buffer's data. You can only read it.</p>
<p>You should use the <a href="qaudiobuffer.html#constData">constData</a>() function rather than this to prevent accidental deep copying.</p>
<p>There is also a templatized version of this data() function that allows you to retrieve a specific type of read-only pointer to the data. Note that there is no checking done on the format of the audio buffer - this is simply a convenience function.</p>
<pre class="cpp">
<span class="comment">// With a 16bit sample const buffer:</span>
<span class="keyword">const</span> <span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> <span class="operator">*</span>data <span class="operator">=</span> buffer<span class="operator">-</span><span class="operator">></span>data<span class="operator"><</span><span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span><span class="operator">></span>();
</pre>
<!-- @@@data -->
<!-- $$$data$$$data -->
<h3 class="fn" id="data-1"><a name="data-1"></a><span class="type">void</span> *QAudioBuffer::<span class="name">data</span>()</h3>
<p>Returns a pointer to this buffer's data. You can modify the data through the returned pointer.</p>
<p>Since QAudioBuffers can share the actual sample data, calling this function will result in a deep copy being made if there are any other buffers using the sample. You should avoid calling this unless you really need to modify the data.</p>
<p>This pointer will remain valid until the underlying storage is detached. In particular, if you obtain a pointer, and then copy this audio buffer, changing data through this pointer may change both buffer instances. Calling <a href="qaudiobuffer.html#data">data</a>() on either instance will again cause a deep copy to be made, which may invalidate the pointers returned from this function previously.</p>
<p>There is also a templatized version of <a href="qaudiobuffer.html#data">data</a>() allows you to retrieve a specific type of pointer to the data. Note that there is no checking done on the format of the audio buffer - this is simply a convenience function.</p>
<pre class="cpp">
<span class="comment">// With a 16bit sample buffer:</span>
<span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> <span class="operator">*</span>data <span class="operator">=</span> buffer<span class="operator">-</span><span class="operator">></span>data<span class="operator"><</span><span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span><span class="operator">></span>(); <span class="comment">// May cause deep copy</span>
</pre>
<!-- @@@data -->
<!-- $$$data$$$data -->
<h3 class="fn" id="data-2"><a name="data-2"></a>const <span class="type">T</span> *QAudioBuffer::<span class="name">data</span>() const</h3>
<!-- @@@data -->
<!-- $$$data$$$data -->
<h3 class="fn" id="data-3"><a name="data-3"></a><span class="type">T</span> *QAudioBuffer::<span class="name">data</span>()</h3>
<!-- @@@data -->
<!-- $$$duration[overload1]$$$duration -->
<h3 class="fn" id="duration"><a name="duration"></a><span class="type"><a href="../qtcore/qtglobal.html#qint64-typedef">qint64</a></span> QAudioBuffer::<span class="name">duration</span>() const</h3>
<p>Returns the duration of audio in this buffer, in microseconds.</p>
<p>This depends on the <a href="qaudiobuffer.html#format">format</a>(), and the <a href="qaudiobuffer.html#frameCount">frameCount</a>().</p>
<!-- @@@duration -->
<!-- $$$format[overload1]$$$format -->
<h3 class="fn" id="format"><a name="format"></a><span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> QAudioBuffer::<span class="name">format</span>() const</h3>
<p>Returns the <a href="qaudioformat.html">format</a> of this buffer.</p>
<p>Several properties of this format influence how the <a href="qaudiobuffer.html#duration">duration</a>() or <a href="qaudiobuffer.html#byteCount">byteCount</a>() are calculated from the <a href="qaudiobuffer.html#frameCount">frameCount</a>().</p>
<!-- @@@format -->
<!-- $$$frameCount[overload1]$$$frameCount -->
<h3 class="fn" id="frameCount"><a name="frameCount"></a><span class="type">int</span> QAudioBuffer::<span class="name">frameCount</span>() const</h3>
<p>Returns the number of complete audio frames in this buffer.</p>
<p>An audio frame is an interleaved set of one sample per channel for the same instant in time.</p>
<!-- @@@frameCount -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn" id="isValid"><a name="isValid"></a><span class="type">bool</span> QAudioBuffer::<span class="name">isValid</span>() const</h3>
<p>Returns true if this is a valid buffer. A valid buffer has more than zero frames in it and a valid format.</p>
<!-- @@@isValid -->
<!-- $$$sampleCount[overload1]$$$sampleCount -->
<h3 class="fn" id="sampleCount"><a name="sampleCount"></a><span class="type">int</span> QAudioBuffer::<span class="name">sampleCount</span>() const</h3>
<p>Returns the number of samples in this buffer.</p>
<p>If the format of this buffer has multiple channels, then this count includes all channels. This means that a stereo buffer with 1000 samples in total will have 500 left samples and 500 right samples (interleaved), and this function will return 1000.</p>
<p><b>See also </b><a href="qaudiobuffer.html#frameCount">frameCount</a>().</p>
<!-- @@@sampleCount -->
<!-- $$$startTime[overload1]$$$startTime -->
<h3 class="fn" id="startTime"><a name="startTime"></a><span class="type"><a href="../qtcore/qtglobal.html#qint64-typedef">qint64</a></span> QAudioBuffer::<span class="name">startTime</span>() const</h3>
<p>Returns the time in a stream that this buffer starts at (in microseconds).</p>
<p>If this buffer is not part of a stream, this will return -1.</p>
<!-- @@@startTime -->
<!-- $$$operator=[overload1]$$$operator=constQAudioBuffer& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qaudiobuffer.html#QAudioBuffer">QAudioBuffer</a></span> &QAudioBuffer::<span class="name">operator=</span>(const <span class="type"><a href="qaudiobuffer.html#QAudioBuffer">QAudioBuffer</a></span> &<i>other</i>)</h3>
<p>Assigns the <i>other</i> buffer to this.</p>
<!-- @@@operator= -->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2017 The Qt Company Ltd.
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> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|