Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 4879

qt-doc-4.8.5-10.fc18.noarch.rpm

<?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" />
<!-- qaudiooutput.cpp -->
  <title>Qt 4.8: QAudioOutput Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <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>QAudioOutput</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></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>
</ul>
</div>
<h1 class="title">QAudioOutput Class Reference</h1>
<!-- $$$QAudioOutput-brief -->
<p>The QAudioOutput class provides an interface for sending audio data to an audio output device. <a href="#details">More...</a></p>
<!-- @@@QAudioOutput -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QAudioOutput&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="qaudiooutput-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="qaudiooutput.html#QAudioOutput">QAudioOutput</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="qaudiooutput.html#QAudioOutput-2">QAudioOutput</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="qaudiooutput.html#dtor.QAudioOutput">~QAudioOutput</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#bufferSize">bufferSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#bytesFree">bytesFree</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#elapsedUSecs">elapsedUSecs</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudio::Error </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#error">error</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudioFormat </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#format">format</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#notifyInterval">notifyInterval</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#periodSize">periodSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#processedUSecs">processedUSecs</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#reset">reset</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#resume">resume</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.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="qaudiooutput.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="qaudiooutput.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="qaudiooutput.html#start-2">start</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudio::State </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#state">state</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.html#stop">stop</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.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="qaudiooutput.html#notify">notify</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaudiooutput.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>
<!-- $$$QAudioOutput-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QAudioOutput class provides an interface for sending audio data to an audio output device.</p>
<p>You can construct an audio output with the system's <a href="qaudiodeviceinfo.html#defaultOutputDevice">default audio output device</a>. It is also possible to create QAudioOutput with a specific <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a>. When you create the audio output, you should also send in the <a href="qaudioformat.html">QAudioFormat</a> to be used for the playback (see the <a href="qaudioformat.html">QAudioFormat</a> class description for details).</p>
<p>To play a file:</p>
<p>Starting to play an audio stream is simply a matter of calling <a href="qaudiooutput.html#start">start</a>() with a <a href="qiodevice.html">QIODevice</a>. QAudioOutput will then fetch the data it needs from the io device. So playing back an audio file is as simple as:</p>
<pre class="cpp">     <span class="type"><a href="qfile.html">QFile</a></span> inputFile;           <span class="comment">// class member.</span>
     <span class="type">QAudioOutput</span> <span class="operator">*</span>audioOutput; <span class="comment">// class member.</span>
     ...
     <span class="type">void</span> startPlaying()
     {
         inputFile<span class="operator">.</span>setFileName(<span class="string">&quot;/tmp/test.raw&quot;</span>);
         inputFile<span class="operator">.</span>open(<span class="type"><a href="qiodevice.html">QIODevice</a></span><span class="operator">::</span>ReadOnly);

         <span class="type"><a href="qaudioformat.html">QAudioFormat</a></span> format;
         <span class="comment">// Set up the format, 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="type"><a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a></span><span class="operator">::</span>defaultOutputDevice());
         <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;raw audio format not supported by backend, cannot play audio.&quot;</span>;
             <span class="keyword">return</span>;
         }

         audioOutput <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QAudioOutput</span>(format<span class="operator">,</span> <span class="keyword">this</span>);
         connect(audioOutput<span class="operator">,</span>SIGNAL(stateChanged(<span class="type"><a href="qaudio.html">QAudio</a></span><span class="operator">::</span>State))<span class="operator">,</span>SLOT(finishedPlaying(<span class="type"><a href="qaudio.html">QAudio</a></span><span class="operator">::</span>State)));
         audioOutput<span class="operator">-</span><span class="operator">&gt;</span>start(<span class="operator">&amp;</span>inputFile);
     }</pre>
<p>The file will start playing assuming that the audio system and output device support it. If you run out of luck, check what's up with the <a href="qaudiooutput.html#error">error</a>() function.</p>
<p>After the file has finished playing, we need to stop the device:</p>
<pre class="cpp">     <span class="type">void</span> finishedPlaying(<span class="type"><a href="qaudio.html">QAudio</a></span><span class="operator">::</span>State state)
     {
         <span class="keyword">if</span> (state <span class="operator">=</span><span class="operator">=</span> <span class="type"><a href="qaudio.html">QAudio</a></span><span class="operator">::</span>IdleState) {
             audioOutput<span class="operator">-</span><span class="operator">&gt;</span>stop();
             inputFile<span class="operator">.</span>close();
             <span class="keyword">delete</span> audioOutput;
         }
     }</pre>
<p>At any given time, the QAudioOutput will be in one of four states: active, suspended, stopped, or idle. These states are described by the <a href="qaudio.html#State-enum">QAudio::State</a> enum. State changes are reported through the <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal. You can use this signal to, for instance, update the GUI of the application; the mundane example here being changing the state of a <tt>play/pause</tt> button. You request a state change directly with <a href="qaudiooutput.html#suspend">suspend</a>(), <a href="qaudiooutput.html#stop">stop</a>(), <a href="qaudiooutput.html#reset">reset</a>(), <a href="qaudiooutput.html#resume">resume</a>(), and <a href="qaudiooutput.html#start">start</a>().</p>
<p>While the stream is playing, you can set a notify interval in milliseconds with <a href="qaudiooutput.html#setNotifyInterval">setNotifyInterval</a>(). This interval specifies the time between two emissions of the <a href="qaudiooutput.html#notify">notify</a>() signal. This is relative to the position in the stream, i.e&#x2e;, if the QAudioOutput is in the SuspendedState or the IdleState, the <a href="qaudiooutput.html#notify">notify</a>() signal is not emitted. A typical use-case would be to update a <a href="qslider.html">slider</a> that allows seeking in the stream. If you want the time since playback started regardless of which states the audio output has been in, <a href="qaudiooutput.html#elapsedUSecs">elapsedUSecs</a>() is the function for you.</p>
<p>If an error occurs, you can fetch the <a href="qaudio.html#Error-enum">error type</a> with the <a href="qaudiooutput.html#error">error</a>() function. Please see the <a href="qaudio.html#Error-enum">QAudio::Error</a> enum for a description of the possible errors that are reported. When an error is encountered, the state changes to <a href="qaudio.html#State-enum">QAudio::StoppedState</a>. You can check for errors by connecting to the <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal:</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> (audioOutput<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="comment">// Normal stop</span>
                 }
                 <span class="keyword">break</span>;</pre>
</div>
<p><b>See also </b><a href="qaudioinput.html">QAudioInput</a> and <a href="qaudiodeviceinfo.html">QAudioDeviceInfo</a>.</p>
<!-- @@@QAudioOutput -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAudioOutput[overload1]$$$QAudioOutputconstQAudioFormat&QObject* -->
<h3 class="fn"><a name="QAudioOutput"></a>QAudioOutput::<span class="name">QAudioOutput</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 output and attach it to <i>parent</i>. The default audio output device is used with the output <i>format</i> parameters.</p>
<!-- @@@QAudioOutput -->
<!-- $$$QAudioOutput$$$QAudioOutputconstQAudioDeviceInfo&constQAudioFormat&QObject* -->
<h3 class="fn"><a name="QAudioOutput-2"></a>QAudioOutput::<span class="name">QAudioOutput</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 output and attach it to <i>parent</i>. The device referenced by <i>audioDevice</i> is used with the output <i>format</i> parameters.</p>
<!-- @@@QAudioOutput -->
<!-- $$$~QAudioOutput[overload1]$$$~QAudioOutput -->
<h3 class="fn"><a name="dtor.QAudioOutput"></a>QAudioOutput::<span class="name">~QAudioOutput</span> ()</h3>
<p>Destroys this audio output.</p>
<!-- @@@~QAudioOutput -->
<!-- $$$bufferSize[overload1]$$$bufferSize -->
<h3 class="fn"><a name="bufferSize"></a><span class="type">int</span> QAudioOutput::<span class="name">bufferSize</span> () const</h3>
<p>Returns the audio buffer size in bytes.</p>
<p>If called before <a href="qaudiooutput.html#start">start</a>(), returns platform default value. If called before <a href="qaudiooutput.html#start">start</a>() but <a href="qaudiooutput.html#setBufferSize">setBufferSize</a>() was called prior, returns value set by <a href="qaudiooutput.html#setBufferSize">setBufferSize</a>(). If called after <a href="qaudiooutput.html#start">start</a>(), returns the actual buffer size being used. This may not be what was set previously by <a href="qaudiooutput.html#setBufferSize">setBufferSize</a>().</p>
<p><b>See also </b><a href="qaudiooutput.html#setBufferSize">setBufferSize</a>().</p>
<!-- @@@bufferSize -->
<!-- $$$bytesFree[overload1]$$$bytesFree -->
<h3 class="fn"><a name="bytesFree"></a><span class="type">int</span> QAudioOutput::<span class="name">bytesFree</span> () const</h3>
<p>Returns the free space available in bytes in the audio buffer.</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>
<!-- @@@bytesFree -->
<!-- $$$elapsedUSecs[overload1]$$$elapsedUSecs -->
<h3 class="fn"><a name="elapsedUSecs"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QAudioOutput::<span class="name">elapsedUSecs</span> () const</h3>
<p>Returns the microseconds since <a href="qaudiooutput.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> QAudioOutput::<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> QAudioOutput::<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> QAudioOutput::<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> QAudioOutput::<span class="name">notifyInterval</span> () const</h3>
<p>Returns the notify interval in milliseconds.</p>
<p><b>See also </b><a href="qaudiooutput.html#setNotifyInterval">setNotifyInterval</a>().</p>
<!-- @@@notifyInterval -->
<!-- $$$periodSize[overload1]$$$periodSize -->
<h3 class="fn"><a name="periodSize"></a><span class="type">int</span> QAudioOutput::<span class="name">periodSize</span> () const</h3>
<p>Returns the period size in bytes.</p>
<p>Note: This is the recommended write 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> QAudioOutput::<span class="name">processedUSecs</span> () const</h3>
<p>Returns the amount of audio data processed by the class since <a href="qaudiooutput.html#start">start</a>() was called in microseconds.</p>
<p>Note: The amount of audio data played can be determined by subtracting the microseconds of audio data still in the systems audio buffer.</p>
<pre class="cpp"> <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> bytesInBuffer <span class="operator">=</span> <a href="qaudiooutput.html#bufferSize">bufferSize</a>() <span class="operator">-</span> <a href="qaudiooutput.html#bytesFree">bytesFree</a>();
 <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> usInBuffer <span class="operator">=</span> (<span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span>)(<span class="number">1000000</span>) <span class="operator">*</span> bytesInBuffer <span class="operator">/</span> ( channels() <span class="operator">*</span> sampleSize() <span class="operator">/</span> <span class="number">8</span> ) <span class="operator">/</span> frequency();
 <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> usPlayed <span class="operator">=</span> processedUSecs() <span class="operator">-</span> usInBuffer;</pre>
<!-- @@@processedUSecs -->
<!-- $$$reset[overload1]$$$reset -->
<h3 class="fn"><a name="reset"></a><span class="type">void</span> QAudioOutput::<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> QAudioOutput::<span class="name">resume</span> ()</h3>
<p>Resumes processing audio data after a <a href="qaudiooutput.html#suspend">suspend</a>().</p>
<p>Sets <a href="qaudiooutput.html#error">error</a>() to <a href="qaudio.html#Error-enum">QAudio::NoError</a>. Sets <a href="qaudiooutput.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="qaudiooutput.html#state">state</a>() to <a href="qaudio.html#State-enum">QAudio::IdleState</a> if you previously called <a href="qaudiooutput.html#start">start</a>(). emits <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal.</p>
<p>Note: signal will always be emitted during execution of the resume() function.</p>
<!-- @@@resume -->
<!-- $$$setBufferSize[overload1]$$$setBufferSizeint -->
<h3 class="fn"><a name="setBufferSize"></a><span class="type">void</span> QAudioOutput::<span class="name">setBufferSize</span> ( <span class="type">int</span> <i>value</i> )</h3>
<p>Sets the audio buffer size to <i>value</i> in bytes.</p>
<p>Note: This function can be called anytime before <a href="qaudiooutput.html#start">start</a>(), calls to this are ignored after <a href="qaudiooutput.html#start">start</a>(). It should not be assumed that the buffer size set is the actual buffer size used, calling <a href="qaudiooutput.html#bufferSize">bufferSize</a>() anytime after <a href="qaudiooutput.html#start">start</a>() will return the actual buffer size being used.</p>
<p><b>See also </b><a href="qaudiooutput.html#bufferSize">bufferSize</a>().</p>
<!-- @@@setBufferSize -->
<!-- $$$setNotifyInterval[overload1]$$$setNotifyIntervalint -->
<h3 class="fn"><a name="setNotifyInterval"></a><span class="type">void</span> QAudioOutput::<span class="name">setNotifyInterval</span> ( <span class="type">int</span> <i>ms</i> )</h3>
<p>Sets the interval for <a href="qaudiooutput.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="qaudiooutput.html#notifyInterval">notifyInterval</a>() to confirm actual value being used.</p>
<p><b>See also </b><a href="qaudiooutput.html#notifyInterval">notifyInterval</a>().</p>
<!-- @@@setNotifyInterval -->
<!-- $$$start[overload1]$$$startQIODevice* -->
<h3 class="fn"><a name="start"></a><span class="type">void</span> QAudioOutput::<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>.</p>
<p>If able to successfully output audio data to the systems audio device the <a href="qaudiooutput.html#state">state</a>() is set to <a href="qaudio.html#State-enum">QAudio::ActiveState</a>, <a href="qaudiooutput.html#error">error</a>() is set to <a href="qaudio.html#Error-enum">QAudio::NoError</a> and the <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal is emitted.</p>
<p>If a problem occurs during this process the <a href="qaudiooutput.html#error">error</a>() is set to <a href="qaudio.html#Error-enum">QAudio::OpenError</a>, <a href="qaudiooutput.html#state">state</a>() is set to <a href="qaudio.html#State-enum">QAudio::StoppedState</a> and <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal is emitted.</p>
<p>In either case, the <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal may be emitted either synchronously during execution of the start() function or asynchronously after start() has returned to the caller.</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> * QAudioOutput::<span class="name">start</span> ()</h3>
<p>Returns a pointer to the <a href="qiodevice.html">QIODevice</a> being used to handle the data transfer. This <a href="qiodevice.html">QIODevice</a> can be used to write() audio data directly.</p>
<p>If able to access the systems audio device the <a href="qaudiooutput.html#state">state</a>() is set to <a href="qaudio.html#State-enum">QAudio::IdleState</a>, <a href="qaudiooutput.html#error">error</a>() is set to <a href="qaudio.html#Error-enum">QAudio::NoError</a> and the <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal is emitted.</p>
<p>If a problem occurs during this process the <a href="qaudiooutput.html#error">error</a>() is set to <a href="qaudio.html#Error-enum">QAudio::OpenError</a>, <a href="qaudiooutput.html#state">state</a>() is set to <a href="qaudio.html#State-enum">QAudio::StoppedState</a> and <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal is emitted.</p>
<p>In either case, the <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal may be emitted either synchronously during execution of the <a href="qaudiooutput.html#start">start</a>() function or asynchronously after <a href="qaudiooutput.html#start">start</a>() has returned to the caller.</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> QAudioOutput::<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> QAudioOutput::<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. This is the current state of the audio output.</p>
<!-- @@@stateChanged -->
<!-- $$$stop[overload1]$$$stop -->
<h3 class="fn"><a name="stop"></a><span class="type">void</span> QAudioOutput::<span class="name">stop</span> ()</h3>
<p>Stops the audio output, detaching from the system resource.</p>
<p>Sets <a href="qaudiooutput.html#error">error</a>() to <a href="qaudio.html#Error-enum">QAudio::NoError</a>, <a href="qaudiooutput.html#state">state</a>() to <a href="qaudio.html#State-enum">QAudio::StoppedState</a> and emit <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal.</p>
<!-- @@@stop -->
<!-- $$$suspend[overload1]$$$suspend -->
<h3 class="fn"><a name="suspend"></a><span class="type">void</span> QAudioOutput::<span class="name">suspend</span> ()</h3>
<p>Stops processing audio data, preserving buffered audio data.</p>
<p>Sets <a href="qaudiooutput.html#error">error</a>() to <a href="qaudio.html#Error-enum">QAudio::NoError</a>, <a href="qaudiooutput.html#state">state</a>() to <a href="qaudio.html#State-enum">QAudio::SuspendedState</a> and emit <a href="qaudiooutput.html#stateChanged">stateChanged</a>() signal.</p>
<!-- @@@suspend -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </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.</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>
      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. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>