File: qaudioinput.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (287 lines) | stat: -rw-r--r-- 29,524 bytes parent folder | download
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<?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" />
<!-- qaudioinput.cpp -->
  <title>Qt 4.8: QAudioInput 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>QAudioInput</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-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#symbian-platform-security-requirements">Symbian Platform Security Requirements</a></li>
</ul>
</div>
<h1 class="title">QAudioInput Class Reference</h1>
<!-- $$$QAudioInput-brief -->
<p>The QAudioInput class provides an interface for receiving audio data from an audio input device. <a href="#details">More...</a></p>
<!-- @@@QAudioInput -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QAudioInput&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<p>This class was introduced in Qt 4.6.</p>
<ul>
<li><a href="qaudioinput-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="qaudioinput.html#QAudioInput">QAudioInput</a></b> ( const QAudioFormat &amp; <i>format</i> = QAudioFormat(), QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#QAudioInput-2">QAudioInput</a></b> ( const QAudioDeviceInfo &amp; <i>audioDevice</i>, const QAudioFormat &amp; <i>format</i> = QAudioFormat(), QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#dtor.QAudioInput">~QAudioInput</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#bufferSize">bufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#bytesReady">bytesReady</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#elapsedUSecs">elapsedUSecs</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudio::Error </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#error">error</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioFormat </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#format">format</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#notifyInterval">notifyInterval</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#periodSize">periodSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#processedUSecs">processedUSecs</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#reset">reset</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#resume">resume</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#setBufferSize">setBufferSize</a></b> ( int <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#setNotifyInterval">setNotifyInterval</a></b> ( int <i>ms</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#start">start</a></b> ( QIODevice * <i>device</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIODevice * </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#start-2">start</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudio::State </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#state">state</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#stop">stop</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#suspend">suspend</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#notify">notify</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudioinput.html#stateChanged">stateChanged</a></b> ( QAudio::State <i>state</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QAudioInput-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QAudioInput class provides an interface for receiving audio data from an audio input device.</p>
<p>You can construct an audio input with the system's <a href="qaudiodeviceinfo.html#defaultInputDevice">default audio input device</a>. It is also possible to create QAudioInput with a specific <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a>. When you create the audio input, you should also send in the <a href="qaudioformat.html">QAudioFormat</a> to be used for the recording (see the <a href="qaudioformat.html">QAudioFormat</a> class description for details).</p>
<p>To record to a file:</p>
<p>QAudioInput lets you record audio with an audio input device. The default constructor of this class will use the systems default audio device, but you can also specify a <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a> for a specific device. You also need to pass in the <a href="qaudioformat.html">QAudioFormat</a> in which you wish to record.</p>
<p>Starting up the QAudioInput is simply a matter of calling <a href="qaudioinput.html#start">start</a>() with a <a href="qiodevice.html">QIODevice</a> opened for writing. For instance, to record to a file, you can:</p>
<pre class="cpp">     <span class="type"><a href="qfile.html">QFile</a></span> outputFile;         <span class="comment">// class member.</span>
     <span class="type">QAudioInput</span> <span class="operator">*</span>audioInput;  <span class="comment">// class member.</span>
     ...
     <span class="type">void</span> startRecording()
     {
         outputFile<span class="operator">.</span>setFileName(<span class="string">&quot;/tmp/test.raw&quot;</span>);
         outputFile<span class="operator">.</span>open( <span class="type"><a href="qiodevice.html">QIODevice</a></span><span class="operator">::</span>WriteOnly <span class="operator">|</span> <span class="type"><a href="qiodevice.html">QIODevice</a></span><span class="operator">::</span>Truncate );

         <span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> format;
         <span class="comment">// set up the format you want, eg.</span>
         format<span class="operator">.</span>setFrequency(<span class="number">8000</span>);
         format<span class="operator">.</span>setChannels(<span class="number">1</span>);
         format<span class="operator">.</span>setSampleSize(<span class="number">8</span>);
         format<span class="operator">.</span>setCodec(<span class="string">&quot;audio/pcm&quot;</span>);
         format<span class="operator">.</span>setByteOrder(<span class="type"><a href="qaudioformat.html">QAudioFormat</a></span><span class="operator">::</span>LittleEndian);
         format<span class="operator">.</span>setSampleType(<span class="type"><a href="qaudioformat.html">QAudioFormat</a></span><span class="operator">::</span>UnSignedInt);

         <span class="type"><a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a></span> info <span class="operator">=</span> <span class="type"><a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a></span><span class="operator">::</span>defaultInputDevice();
         <span class="keyword">if</span> (<span class="operator">!</span>info<span class="operator">.</span>isFormatSupported(format)) {
             <a href="qtglobal.html#qWarning">qWarning</a>()<span class="operator">&lt;</span><span class="operator">&lt;</span><span class="string">&quot;default format not supported try to use nearest&quot;</span>;
             format <span class="operator">=</span> info<span class="operator">.</span>nearestFormat(format);
         }

         audioInput <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QAudioInput</span>(format<span class="operator">,</span> <span class="keyword">this</span>);
         <span class="type"><a href="qtimer.html">QTimer</a></span><span class="operator">::</span>singleShot(<span class="number">3000</span><span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(stopRecording()));
         audioInput<span class="operator">-</span><span class="operator">&gt;</span>start(<span class="operator">&amp;</span>outputFile);
         <span class="comment">// Records audio for 3000ms</span>
     }</pre>
<p>This will start recording if the format specified is supported by the input device (you can check this with <a href="qaudiodeviceinfo.html#isFormatSupported">QAudioDeviceInfo::isFormatSupported</a>(). In case there are any snags, use the <a href="qaudioinput.html#error">error</a>() function to check what went wrong. We stop recording in the <tt>stopRecording()</tt> slot.</p>
<pre class="cpp">     <span class="type">void</span> stopRecording()
     {
         audioInput<span class="operator">-</span><span class="operator">&gt;</span>stop();
         outputFile<span class="operator">.</span>close();
         <span class="keyword">delete</span> audioInput;
     }</pre>
<p>At any point in time, QAudioInput will be in one of four states: active, suspended, stopped, or idle. These states are specified by the <a href="qaudio.html#State-enum">QAudio::State</a> enum. You can request a state change directly through <a href="qaudioinput.html#suspend">suspend</a>(), <a href="qaudioinput.html#resume">resume</a>(), <a href="qaudioinput.html#stop">stop</a>(), <a href="qaudioinput.html#reset">reset</a>(), and <a href="qaudioinput.html#start">start</a>(). The current state is reported by <a href="qaudioinput.html#state">state</a>(). <a href="qaudiooutput.html">QAudioOutput</a> will also signal you when the state changes (<a href="qaudioinput.html#stateChanged">stateChanged</a>()).</p>
<p>QAudioInput provides several ways of measuring the time that has passed since the <a href="qaudioinput.html#start">start</a>() of the recording. The <tt>processedUSecs()</tt> function returns the length of the stream in microseconds written, i.e&#x2e;, it leaves out the times the audio input was suspended or idle. The <a href="qaudioinput.html#elapsedUSecs">elapsedUSecs</a>() function returns the time elapsed since <a href="qaudioinput.html#start">start</a>() was called regardless of which states the QAudioInput has been in.</p>
<p>If an error should occur, you can fetch its reason with <a href="qaudioinput.html#error">error</a>(). The possible error reasons are described by the <a href="qaudio.html#Error-enum">QAudio::Error</a> enum. The QAudioInput will enter the <a href="qaudio.html#State-enum">StoppedState</a> when an error is encountered. Connect to the <a href="qaudioinput.html#stateChanged">stateChanged</a>() signal to handle the error:</p>
<pre class="cpp">     <span class="type">void</span> stateChanged(<span class="type"><a href="qaudio.html">QAudio</a></span><span class="operator">::</span>State newState)
     {
         <span class="keyword">switch</span>(newState) {
             <span class="keyword">case</span> <span class="type"><a href="qaudio.html">QAudio</a></span><span class="operator">::</span>StoppedState:
             <span class="keyword">if</span> (audioInput<span class="operator">-</span><span class="operator">&gt;</span>error() <span class="operator">!</span><span class="operator">=</span> <span class="type"><a href="qaudio.html">QAudio</a></span><span class="operator">::</span>NoError) {
                  <span class="comment">// Perform error handling</span>
             } <span class="keyword">else</span> {

             }
             <span class="keyword">break</span>;</pre>
<a name="symbian-platform-security-requirements"></a>
<h3>Symbian Platform Security Requirements</h3>
<p>On Symbian, processes which use this class must have the <tt>UserEnvironment</tt> platform security capability. If the client process lacks this capability, calls to either overload of <a href="qaudioinput.html#start">start</a>() will fail. This failure is indicated by the QAudioInput object setting its <a href="qaudioinput.html#error">error</a>() value to <a href="qaudio.html#Error-enum">QAudio::OpenError</a> and then emitting a <a href="qaudioinput.html#stateChanged">stateChanged</a>(<a href="qaudio.html#State-enum">QAudio::StoppedState</a>) signal.</p>
<p>Platform security capabilities are added via the <a href="qmake-variable-reference.html#target-capability">TARGET.CAPABILITY</a> qmake variable.</p>
</div>
<p><b>See also </b><a href="qaudiooutput.html">QAudioOutput</a> and <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a>.</p>
<!-- @@@QAudioInput -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAudioInput[overload1]$$$QAudioInputconstQAudioFormat&QObject* -->
<h3 class="fn"><a name="QAudioInput"></a>QAudioInput::<span class="name">QAudioInput</span> ( const <span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> &amp; <i>format</i> = QAudioFormat(), <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Construct a new audio input and attach it to <i>parent</i>. The default audio input device is used with the output <i>format</i> parameters.</p>
<!-- @@@QAudioInput -->
<!-- $$$QAudioInput$$$QAudioInputconstQAudioDeviceInfo&constQAudioFormat&QObject* -->
<h3 class="fn"><a name="QAudioInput-2"></a>QAudioInput::<span class="name">QAudioInput</span> ( const <span class="type"><a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a></span> &amp; <i>audioDevice</i>, const <span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> &amp; <i>format</i> = QAudioFormat(), <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Construct a new audio input and attach it to <i>parent</i>. The device referenced by <i>audioDevice</i> is used with the input <i>format</i> parameters.</p>
<!-- @@@QAudioInput -->
<!-- $$$~QAudioInput[overload1]$$$~QAudioInput -->
<h3 class="fn"><a name="dtor.QAudioInput"></a>QAudioInput::<span class="name">~QAudioInput</span> ()</h3>
<p>Destroy this audio input.</p>
<!-- @@@~QAudioInput -->
<!-- $$$bufferSize[overload1]$$$bufferSize -->
<h3 class="fn"><a name="bufferSize"></a><span class="type">int</span> QAudioInput::<span class="name">bufferSize</span> () const</h3>
<p>Returns the audio buffer size in milliseconds.</p>
<p>If called before <a href="qaudioinput.html#start">start</a>(), returns platform default value. If called before <a href="qaudioinput.html#start">start</a>() but <a href="qaudioinput.html#setBufferSize">setBufferSize</a>() was called prior, returns value set by <a href="qaudioinput.html#setBufferSize">setBufferSize</a>(). If called after <a href="qaudioinput.html#start">start</a>(), returns the actual buffer size being used. This may not be what was set previously by <a href="qaudioinput.html#setBufferSize">setBufferSize</a>().</p>
<p><b>See also </b><a href="qaudioinput.html#setBufferSize">setBufferSize</a>().</p>
<!-- @@@bufferSize -->
<!-- $$$bytesReady[overload1]$$$bytesReady -->
<h3 class="fn"><a name="bytesReady"></a><span class="type">int</span> QAudioInput::<span class="name">bytesReady</span> () const</h3>
<p>Returns the amount of audio data available to read in bytes.</p>
<p>NOTE: returned value is only valid while in <a href="qaudio.html#State-enum">QAudio::ActiveState</a> or <a href="qaudio.html#State-enum">QAudio::IdleState</a> state, otherwise returns zero.</p>
<!-- @@@bytesReady -->
<!-- $$$elapsedUSecs[overload1]$$$elapsedUSecs -->
<h3 class="fn"><a name="elapsedUSecs"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QAudioInput::<span class="name">elapsedUSecs</span> () const</h3>
<p>Returns the microseconds since <a href="qaudioinput.html#start">start</a>() was called, including time in Idle and Suspend states.</p>
<!-- @@@elapsedUSecs -->
<!-- $$$error[overload1]$$$error -->
<h3 class="fn"><a name="error"></a><span class="type"><a href="qaudio.html#Error-enum">QAudio::Error</a></span> QAudioInput::<span class="name">error</span> () const</h3>
<p>Returns the error state.</p>
<!-- @@@error -->
<!-- $$$format[overload1]$$$format -->
<h3 class="fn"><a name="format"></a><span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> QAudioInput::<span class="name">format</span> () const</h3>
<p>Returns the <a href="qaudioformat.html">QAudioFormat</a> being used.</p>
<!-- @@@format -->
<!-- $$$notify[overload1]$$$notify -->
<h3 class="fn"><a name="notify"></a><span class="type">void</span> QAudioInput::<span class="name">notify</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when x ms of audio data has been processed the interval set by setNotifyInterval(x).</p>
<!-- @@@notify -->
<!-- $$$notifyInterval[overload1]$$$notifyInterval -->
<h3 class="fn"><a name="notifyInterval"></a><span class="type">int</span> QAudioInput::<span class="name">notifyInterval</span> () const</h3>
<p>Returns the notify interval in milliseconds.</p>
<p><b>See also </b><a href="qaudioinput.html#setNotifyInterval">setNotifyInterval</a>().</p>
<!-- @@@notifyInterval -->
<!-- $$$periodSize[overload1]$$$periodSize -->
<h3 class="fn"><a name="periodSize"></a><span class="type">int</span> QAudioInput::<span class="name">periodSize</span> () const</h3>
<p>Returns the period size in bytes.</p>
<p>Note: This is the recommended read size in bytes.</p>
<!-- @@@periodSize -->
<!-- $$$processedUSecs[overload1]$$$processedUSecs -->
<h3 class="fn"><a name="processedUSecs"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QAudioInput::<span class="name">processedUSecs</span> () const</h3>
<p>Returns the amount of audio data processed since <a href="qaudioinput.html#start">start</a>() was called in microseconds.</p>
<!-- @@@processedUSecs -->
<!-- $$$reset[overload1]$$$reset -->
<h3 class="fn"><a name="reset"></a><span class="type">void</span> QAudioInput::<span class="name">reset</span> ()</h3>
<p>Drops all audio data in the buffers, resets buffers to zero.</p>
<!-- @@@reset -->
<!-- $$$resume[overload1]$$$resume -->
<h3 class="fn"><a name="resume"></a><span class="type">void</span> QAudioInput::<span class="name">resume</span> ()</h3>
<p>Resumes processing audio data after a <a href="qaudioinput.html#suspend">suspend</a>().</p>
<p>Sets <a href="qaudioinput.html#error">error</a>() to <a href="qaudio.html#Error-enum">QAudio::NoError</a>. Sets <a href="qaudioinput.html#state">state</a>() to <a href="qaudio.html#State-enum">QAudio::ActiveState</a> if you previously called start(<a href="qiodevice.html">QIODevice</a>*). Sets <a href="qaudioinput.html#state">state</a>() to <a href="qaudio.html#State-enum">QAudio::IdleState</a> if you previously called <a href="qaudioinput.html#start">start</a>(). emits <a href="qaudioinput.html#stateChanged">stateChanged</a>() signal.</p>
<!-- @@@resume -->
<!-- $$$setBufferSize[overload1]$$$setBufferSizeint -->
<h3 class="fn"><a name="setBufferSize"></a><span class="type">void</span> QAudioInput::<span class="name">setBufferSize</span> ( <span class="type">int</span> <i>value</i> )</h3>
<p>Sets the audio buffer size to <i>value</i> milliseconds.</p>
<p>Note: This function can be called anytime before <a href="qaudioinput.html#start">start</a>(), calls to this are ignored after <a href="qaudioinput.html#start">start</a>(). It should not be assumed that the buffer size set is the actual buffer size used, calling <a href="qaudioinput.html#bufferSize">bufferSize</a>() anytime after <a href="qaudioinput.html#start">start</a>() will return the actual buffer size being used.</p>
<p><b>See also </b><a href="qaudioinput.html#bufferSize">bufferSize</a>().</p>
<!-- @@@setBufferSize -->
<!-- $$$setNotifyInterval[overload1]$$$setNotifyIntervalint -->
<h3 class="fn"><a name="setNotifyInterval"></a><span class="type">void</span> QAudioInput::<span class="name">setNotifyInterval</span> ( <span class="type">int</span> <i>ms</i> )</h3>
<p>Sets the interval for <a href="qaudioinput.html#notify">notify</a>() signal to be emitted. This is based on the <i>ms</i> of audio data processed not on actual real-time. The minimum resolution of the timer is platform specific and values should be checked with <a href="qaudioinput.html#notifyInterval">notifyInterval</a>() to confirm actual value being used.</p>
<p><b>See also </b><a href="qaudioinput.html#notifyInterval">notifyInterval</a>().</p>
<!-- @@@setNotifyInterval -->
<!-- $$$start[overload1]$$$startQIODevice* -->
<h3 class="fn"><a name="start"></a><span class="type">void</span> QAudioInput::<span class="name">start</span> ( <span class="type"><a href="qiodevice.html">QIODevice</a></span> * <i>device</i> )</h3>
<p>Uses the <i>device</i> as the <a href="qiodevice.html">QIODevice</a> to transfer data. Passing a <a href="qiodevice.html">QIODevice</a> allows the data to be transferred without any extra code. All that is required is to open the <a href="qiodevice.html">QIODevice</a>. <a href="qaudioinput.html">QAudioInput</a> does not take ownership of <i>device</i>.</p>
<p>The <a href="qaudioinput.html">QAudioInput</a> will write to the device when new data is available. You can subclass <a href="qiodevice.html">QIODevice</a> and reimplement <a href="qiodevice.html#writeData">writeData()</a> if you wish to access the data. If you simply want to save data to a file, you can pass a <a href="qfile.html">QFile</a> to this function.</p>
<p>If able to successfully get audio data from the systems audio device the <a href="qaudioinput.html#state">state</a>() is set to either <a href="qaudio.html#State-enum">QAudio::ActiveState</a> or <a href="qaudio.html#State-enum">QAudio::IdleState</a>, <a href="qaudioinput.html#error">error</a>() is set to <a href="qaudio.html#Error-enum">QAudio::NoError</a> and the <a href="qaudioinput.html#stateChanged">stateChanged</a>() signal is emitted.</p>
<p>If a problem occurs during this process the <a href="qaudioinput.html#error">error</a>() is set to <a href="qaudio.html#Error-enum">QAudio::OpenError</a>, <a href="qaudioinput.html#state">state</a>() is set to <a href="qaudio.html#State-enum">QAudio::StoppedState</a> and <a href="qaudioinput.html#stateChanged">stateChanged</a>() signal is emitted.</p>
<p><a href="qaudioinput.html#symbian-platform-security-requirements">QAudioInput#Symbian Platform Security Requirements</a></p>
<p><b>See also </b><a href="qiodevice.html">QIODevice</a>.</p>
<!-- @@@start -->
<!-- $$$start$$$start -->
<h3 class="fn"><a name="start-2"></a><span class="type"><a href="qiodevice.html">QIODevice</a></span> * QAudioInput::<span class="name">start</span> ()</h3>
<p>Returns a pointer to a new <a href="qiodevice.html">QIODevice</a> that will be used to handle the data transfer. This <a href="qiodevice.html">QIODevice</a> can be used to <a href="qiodevice.html#read">read()</a> audio data directly. You will typically connect to the <a href="qiodevice.html#readyRead">readyRead()</a> signal, and read from the device in the slot you connect to. <a href="qaudioinput.html">QAudioInput</a> keeps ownership of the device.</p>
<p>If able to access the systems audio device the <a href="qaudioinput.html#state">state</a>() is set to <a href="qaudio.html#State-enum">QAudio::IdleState</a>, <a href="qaudioinput.html#error">error</a>() is set to <a href="qaudio.html#Error-enum">QAudio::NoError</a> and the <a href="qaudioinput.html#stateChanged">stateChanged</a>() signal is emitted.</p>
<p>If a problem occurs during this process the <a href="qaudioinput.html#error">error</a>() is set to <a href="qaudio.html#Error-enum">QAudio::OpenError</a>, <a href="qaudioinput.html#state">state</a>() is set to <a href="qaudio.html#State-enum">QAudio::StoppedState</a> and <a href="qaudioinput.html#stateChanged">stateChanged</a>() signal is emitted.</p>
<p><a href="qaudioinput.html#symbian-platform-security-requirements">QAudioInput#Symbian Platform Security Requirements</a></p>
<p><b>See also </b><a href="qiodevice.html">QIODevice</a>.</p>
<!-- @@@start -->
<!-- $$$state[overload1]$$$state -->
<h3 class="fn"><a name="state"></a><span class="type"><a href="qaudio.html#State-enum">QAudio::State</a></span> QAudioInput::<span class="name">state</span> () const</h3>
<p>Returns the state of audio processing.</p>
<!-- @@@state -->
<!-- $$$stateChanged[overload1]$$$stateChangedQAudio::State -->
<h3 class="fn"><a name="stateChanged"></a><span class="type">void</span> QAudioInput::<span class="name">stateChanged</span> ( <span class="type"><a href="qaudio.html#State-enum">QAudio::State</a></span> <i>state</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the device <i>state</i> has changed.</p>
<!-- @@@stateChanged -->
<!-- $$$stop[overload1]$$$stop -->
<h3 class="fn"><a name="stop"></a><span class="type">void</span> QAudioInput::<span class="name">stop</span> ()</h3>
<p>Stops the audio input, detaching from the system resource.</p>
<p>Sets <a href="qaudioinput.html#error">error</a>() to <a href="qaudio.html#Error-enum">QAudio::NoError</a>, <a href="qaudioinput.html#state">state</a>() to <a href="qaudio.html#State-enum">QAudio::StoppedState</a> and emit <a href="qaudioinput.html#stateChanged">stateChanged</a>() signal.</p>
<!-- @@@stop -->
<!-- $$$suspend[overload1]$$$suspend -->
<h3 class="fn"><a name="suspend"></a><span class="type">void</span> QAudioInput::<span class="name">suspend</span> ()</h3>
<p>Stops processing audio data, preserving buffered audio data.</p>
<p>Sets <a href="qaudioinput.html#error">error</a>() to <a href="qaudio.html#Error-enum">QAudio::NoError</a>, <a href="qaudioinput.html#state">state</a>() to <a href="qaudio.html#State-enum">QAudio::SuspendedState</a> and emit <a href="qaudioinput.html#stateChanged">stateChanged</a>() signal.</p>
<!-- @@@suspend -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</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>