Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > os > by-pkgid > 9c481c872fb0ae0cbadccdc2f4a18ab6 > files > 166

libasync-devel-0.17.0-5.fc14.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Async: Async::AudioIO Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2-20100208 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceAsync.html">Async</a>::<a class="el" href="classAsync_1_1AudioIO.html">AudioIO</a>
  </div>
</div>
<div class="contents">
<h1>Async::AudioIO Class Reference</h1><!-- doxytag: class="Async::AudioIO" --><!-- doxytag: inherits="Async::AudioSource,Async::AudioSink" -->
<p>A class for handling audio input/output to an audio device.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Async::AudioIO:</div>
<div class="dynsection">
 <div class="center">
  <img src="classAsync_1_1AudioIO.png" usemap="#Async::AudioIO_map" alt=""/>
  <map id="Async::AudioIO_map" name="Async::AudioIO_map">
<area href="classAsync_1_1AudioSource.html" alt="Async::AudioSource" shape="rect" coords="0,0,128,24"/>
<area href="classAsync_1_1AudioSink.html" alt="Async::AudioSink" shape="rect" coords="138,0,266,24"/>
</map>
 </div>
</div>

<p><a href="classAsync_1_1AudioIO-members.html">List of all members.</a></p>
<h2>Public Types</h2>
<ul>
<li>enum <a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529">Mode</a> { <a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529ad980bc2123c355f49f3a3ad1ac1eb461">MODE_NONE</a>, 
<a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529a454a78d4301a2b5fcdc9a14922948a2f">MODE_RD</a>, 
<a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529ae1fce72086232e1ef93d17a2e032a717">MODE_WR</a>, 
<a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529af9fe65824033e97c01daa096ec75db8e">MODE_RDWR</a>
 }
<dl class="el"><dd class="mdescRight"><p>The different modes to open a device in. </p>
 <a href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529">More...</a><br/></dl></ul>
<h2>Public Member Functions</h2>
<ul>
<li><a class="el" href="classAsync_1_1AudioIO.html#a3635949f609f1c4a06ea4532c1882f75">AudioIO</a> (const std::string &amp;dev_name, int channel)
<dl class="el"><dd class="mdescRight">Constructor.  <a href="#a3635949f609f1c4a06ea4532c1882f75"></a><br/></dl><li><a class="el" href="classAsync_1_1AudioIO.html#a85e119cde5b0a329ce2828788272c7af">~AudioIO</a> (void)
<dl class="el"><dd class="mdescRight">Destructor.  <a href="#a85e119cde5b0a329ce2828788272c7af"></a><br/></dl><li>bool <a class="el" href="classAsync_1_1AudioIO.html#a389e12cafc0ac9d7ba8c3836d7871051">isFullDuplexCapable</a> (void)
<dl class="el"><dd class="mdescRight">Check if the audio device is capable of full duplex operation.  <a href="#a389e12cafc0ac9d7ba8c3836d7871051"></a><br/></dl><li>bool <a class="el" href="classAsync_1_1AudioIO.html#a60aa4a111385aeea9e3142a6670fe859">open</a> (<a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529">Mode</a> mode)
<dl class="el"><dd class="mdescRight">Open the audio device in the specified mode.  <a href="#a60aa4a111385aeea9e3142a6670fe859"></a><br/></dl><li>void <a class="el" href="classAsync_1_1AudioIO.html#a9b489517c73a42cc1c5a781736be5702">close</a> (void)
<dl class="el"><dd class="mdescRight">Close the adio device.  <a href="#a9b489517c73a42cc1c5a781736be5702"></a><br/></dl><li><a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529">Mode</a> <a class="el" href="classAsync_1_1AudioIO.html#a8ed7982564e5a558915cced8ae70d2bc">mode</a> (void) const 
<dl class="el"><dd class="mdescRight">Find out how many samples there are in the output buffer.  <a href="#a8ed7982564e5a558915cced8ae70d2bc"></a><br/></dl><li>void <a class="el" href="classAsync_1_1AudioIO.html#abf44bb0d6148b7c8bf0376ec200d1d2c">setGain</a> (float gain)
<dl class="el"><dd class="mdescRight">Set the gain to use.  <a href="#abf44bb0d6148b7c8bf0376ec200d1d2c"></a><br/></dl><li>float <a class="el" href="classAsync_1_1AudioIO.html#af680b696dba4a0ec6f76c886252aab6e">gain</a> (void) const 
<dl class="el"><dd class="mdescRight">Return the gain.  <a href="#af680b696dba4a0ec6f76c886252aab6e"></a><br/></dl><li>int <a class="el" href="classAsync_1_1AudioIO.html#aaf3c934faa7ac41578edaaf2d506fafb">sampleRate</a> (void) const 
<dl class="el"><dd class="mdescRight">Return the sample rate.  <a href="#aaf3c934faa7ac41578edaaf2d506fafb"></a><br/></dl><li>int <a class="el" href="classAsync_1_1AudioIO.html#abef00b2a149a1465897fc27ddd5b3294">channel</a> (void) const 
<dl class="el"><dd class="mdescRight">Return the audio channel used.  <a href="#abef00b2a149a1465897fc27ddd5b3294"></a><br/></dl><li>void <a class="el" href="classAsync_1_1AudioIO.html#a7c48d73409ebd957a0c04a85b37e73bd">resumeOutput</a> (void)
<dl class="el"><dd class="mdescRight">Resume audio output to the sink.  <a href="#a7c48d73409ebd957a0c04a85b37e73bd"></a><br/></dl><li>void <a class="el" href="classAsync_1_1AudioIO.html#ae461bbea57b5108e0eb91961d8312c8e">allSamplesFlushed</a> (void)
<dl class="el"><dd class="mdescRight">The registered sink has flushed all samples.  <a href="#ae461bbea57b5108e0eb91961d8312c8e"></a><br/></dl></ul>
<h2>Static Public Member Functions</h2>
<ul>
<li>static void <a class="el" href="classAsync_1_1AudioIO.html#ad9512b57c7509bdf7ba79279313a9013">setSampleRate</a> (int rate)
<dl class="el"><dd class="mdescRight">Set the sample rate used when doing future opens.  <a href="#ad9512b57c7509bdf7ba79279313a9013"></a><br/></dl><li>static int <a class="el" href="classAsync_1_1AudioIO.html#a978686e3209d019fddd8e4ea860a9748">setBlocksize</a> (int size)
<dl class="el"><dd class="mdescRight">Set the blocksize used when opening audio devices.  <a href="#a978686e3209d019fddd8e4ea860a9748"></a><br/></dl><li>static int <a class="el" href="classAsync_1_1AudioIO.html#a6f9d615d8265e562a719f29ac8e503be">blocksize</a> (void)
<dl class="el"><dd class="mdescRight">Find out what the blocksize is set to.  <a href="#a6f9d615d8265e562a719f29ac8e503be"></a><br/></dl><li>static int <a class="el" href="classAsync_1_1AudioIO.html#a58f08f10ac4973c4aba902a50e64f181">setBufferCount</a> (int count)
<dl class="el"><dd class="mdescRight">Set the buffer count used when opening audio devices.  <a href="#a58f08f10ac4973c4aba902a50e64f181"></a><br/></dl><li>static void <a class="el" href="classAsync_1_1AudioIO.html#a728c8d8eb10d34b782c0b8fa52102efc">setChannels</a> (int channels)
<dl class="el"><dd class="mdescRight">Set the number of channels used when doing future opens.  <a href="#a728c8d8eb10d34b782c0b8fa52102efc"></a><br/></dl></ul>
<h2>Friends</h2>
<ul>
<li>class <a class="el" href="classAsync_1_1AudioIO.html#a8fbf9b3017983991713e2cbb819dfd5a">AudioDevice</a>
</ul>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>A class for handling audio input/output to an audio device. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Tobias Blomberg </dd></dl>
<dl class="date"><dt><b>Date:</b></dt><dd>2003-03-23</dd></dl>
<p>This is a class for handling audio input and output to an audio device. For now, the <a class="el" href="classAsync_1_1AudioIO.html" title="A class for handling audio input/output to an audio device.">AudioIO</a> class only works with 16 bit stereo samples. An example usage is shown below.</p>
<p>Multiple <a class="el" href="classAsync_1_1AudioIO.html" title="A class for handling audio input/output to an audio device.">AudioIO</a> objects can use the same audio device as long as the device name is exactly the same.</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor">#include &lt;iostream&gt;</span>
<span class="preprocessor">#include &lt;<a class="code" href="AsyncCppApplication_8h.html" title="The core class for writing asyncronous cpp applications.">AsyncCppApplication.h</a>&gt;</span>
<span class="preprocessor">#include &lt;<a class="code" href="AsyncAudioIO_8h.html" title="Contains a class for handling audio input/output to an audio device.">AsyncAudioIO.h</a>&gt;</span>
<span class="preprocessor">#include &lt;<a class="code" href="AsyncAudioSink_8h.html" title="This file contains the base class for an audio sink.">AsyncAudioSink.h</a>&gt;</span>
<span class="preprocessor">#include &lt;<a class="code" href="AsyncAudioSource_8h.html" title="This file contains the base class for an audio source.">AsyncAudioSource.h</a>&gt;</span>

<span class="keyword">using namespace </span>std;
<span class="keyword">using namespace </span>Async;


<span class="keyword">class </span>MyClass : <span class="keyword">public</span> Async::<a class="code" href="classAsync_1_1AudioSink.html#ae0223d429bd789498549ccc7017f914c" title="Default constuctor.">AudioSink</a>, <span class="keyword">public</span> Async::<a class="code" href="classAsync_1_1AudioSource.html#a9058cdeb8aa465ab5dcf49112b40df8b" title="Default constuctor.">AudioSource</a>
{
  <span class="keyword">public</span>:
    MyClass(<span class="keywordtype">void</span>)
    {
        <span class="comment">// Create a new audio IO object</span>
      audio_io = <span class="keyword">new</span> <a class="code" href="classAsync_1_1AudioIO.html#a3635949f609f1c4a06ea4532c1882f75" title="Constructor.">AudioIO</a>(<span class="stringliteral">&quot;/dev/dsp&quot;</span>, 0);
      
        <span class="comment">// Open it for both reading and writing</span>
      audio_io-&gt;open(<a class="code" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529af9fe65824033e97c01daa096ec75db8e" title="Both read and write.">AudioIO::MODE_RDWR</a>);
      
        <span class="comment">// Register this object as the audio source for sound output</span>
      audio_io-&gt;registerSource(<span class="keyword">this</span>);
      
        <span class="comment">// Register the audio device as the audio source for this object</span>
      <a class="code" href="classAsync_1_1AudioSink.html#a355c87f3f763af97de92f5b9ac4b6327" title="Register an audio source to provide samples to this sink.">registerSource</a>(audio_io);
    }
    
    ~MyClass(<span class="keywordtype">void</span>)
    {
      <span class="keyword">delete</span> audio_io;
    }

      <span class="comment">// AudioSink functions</span>
    <span class="keywordtype">int</span> <a class="code" href="classAsync_1_1AudioSink.html#a490aa6380d6b0069fc501f0d9f62e236" title="Write samples into this audio sink.">writeSamples</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *samples, <span class="keywordtype">int</span> count)
    {
        <span class="comment">// Just loop incoming samples back to the audio device</span>
      <span class="keywordflow">return</span> <a class="code" href="classAsync_1_1AudioSource.html#ad23a249abf0f8fd39d364301364740a6">sinkWriteSamples</a>(samples, count);
    }
    
    <span class="keywordtype">void</span> <a class="code" href="classAsync_1_1AudioSink.html#adde14468248671c6c5c85eb47234e0fa" title="Tell the sink to flush the previously written samples.">flushSamples</a>(<span class="keywordtype">void</span>)
    {
      <a class="code" href="classAsync_1_1AudioSource.html#a5837ec95fef7d668d1c5241cee54646c">sinkFlushSamples</a>();
    }

      <span class="comment">// AudioSource functions</span>
    <span class="keywordtype">void</span> <a class="code" href="classAsync_1_1AudioIO.html#a7c48d73409ebd957a0c04a85b37e73bd" title="Resume audio output to the sink.">resumeOutput</a>(<span class="keywordtype">void</span>)
    {
      <a class="code" href="classAsync_1_1AudioSink.html#a4c16d7b78aade12abc0b57ec1db95f62" title="Tell the source that we are ready to accept more samples.">sourceResumeOutput</a>();
    }
    
    <span class="keywordtype">void</span> <a class="code" href="classAsync_1_1AudioIO.html#ae461bbea57b5108e0eb91961d8312c8e" title="The registered sink has flushed all samples.">allSamplesFlushed</a>(<span class="keywordtype">void</span>)
    {
      <a class="code" href="classAsync_1_1AudioSink.html#a2548622eb5c52ef80f3bd297f290be3c" title="Tell the source that all samples have been flushed.">sourceAllSamplesFlushed</a>();
    }

  <span class="keyword">private</span>:
    <a class="code" href="classAsync_1_1AudioIO.html#a3635949f609f1c4a06ea4532c1882f75" title="Constructor.">AudioIO</a> *audio_io;
    
};

<span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)
{
  CppApplication app;
  MyClass my_class;
  app.exec();
}
</pre></div> <dl><dt><b>Examples: </b></dt><dd>
<p><a class="el" href="AsyncAudioIO__demo_8cpp-example.html#_a2">AsyncAudioIO_demo.cpp</a>.</p>
</dd>
</dl>
<p>Definition at line <a class="el" href="AsyncAudioIO_8h_source.html#l00134">134</a> of file <a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>.</p>
<hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="a89b25e780078902fbfc25383b2877529"></a><!-- doxytag: member="Async::AudioIO::Mode" ref="a89b25e780078902fbfc25383b2877529" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529">Async::AudioIO::Mode</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The different modes to open a device in. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a89b25e780078902fbfc25383b2877529ad980bc2123c355f49f3a3ad1ac1eb461"></a><!-- doxytag: member="MODE_NONE" ref="a89b25e780078902fbfc25383b2877529ad980bc2123c355f49f3a3ad1ac1eb461" args="" -->MODE_NONE</em>&nbsp;</td><td>
<p>No mode. The same as close. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a89b25e780078902fbfc25383b2877529a454a78d4301a2b5fcdc9a14922948a2f"></a><!-- doxytag: member="MODE_RD" ref="a89b25e780078902fbfc25383b2877529a454a78d4301a2b5fcdc9a14922948a2f" args="" -->MODE_RD</em>&nbsp;</td><td>
<p>Read. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a89b25e780078902fbfc25383b2877529ae1fce72086232e1ef93d17a2e032a717"></a><!-- doxytag: member="MODE_WR" ref="a89b25e780078902fbfc25383b2877529ae1fce72086232e1ef93d17a2e032a717" args="" -->MODE_WR</em>&nbsp;</td><td>
<p>Write. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a89b25e780078902fbfc25383b2877529af9fe65824033e97c01daa096ec75db8e"></a><!-- doxytag: member="MODE_RDWR" ref="a89b25e780078902fbfc25383b2877529af9fe65824033e97c01daa096ec75db8e" args="" -->MODE_RDWR</em>&nbsp;</td><td>
<p>Both read and write. </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="AsyncAudioIO_8h_source.html#l00140">140</a> of file <a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>.</p>

</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a3635949f609f1c4a06ea4532c1882f75"></a><!-- doxytag: member="Async::AudioIO::AudioIO" ref="a3635949f609f1c4a06ea4532c1882f75" args="(const std::string &amp;dev_name, int channel)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Async::AudioIO::AudioIO </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>dev_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>channel</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dev_name</em>&nbsp;</td><td>The name of the device to use </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>channel</em>&nbsp;</td><td>The channel number (zero is the first channel) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a85e119cde5b0a329ce2828788272c7af"></a><!-- doxytag: member="Async::AudioIO::~AudioIO" ref="a85e119cde5b0a329ce2828788272c7af" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Async::AudioIO::~AudioIO </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destructor. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ae461bbea57b5108e0eb91961d8312c8e"></a><!-- doxytag: member="Async::AudioIO::allSamplesFlushed" ref="ae461bbea57b5108e0eb91961d8312c8e" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::AudioIO::allSamplesFlushed </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The registered sink has flushed all samples. </p>
<p>This function will be called when all samples have been flushed in the registered sink. This function is normally only called from a connected sink object. </p>

<p>Reimplemented from <a class="el" href="classAsync_1_1AudioSource.html#a563adf6411eddbd056abf206a12354b6">Async::AudioSource</a>.</p>

<p>Definition at line <a class="el" href="AsyncAudioIO_8h_source.html#l00318">318</a> of file <a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>.</p>

</div>
</div>
<a class="anchor" id="a6f9d615d8265e562a719f29ac8e503be"></a><!-- doxytag: member="Async::AudioIO::blocksize" ref="a6f9d615d8265e562a719f29ac8e503be" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static int Async::AudioIO::blocksize </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Find out what the blocksize is set to. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the currently set blocksize in samples per channel </dd></dl>

</div>
</div>
<a class="anchor" id="abef00b2a149a1465897fc27ddd5b3294"></a><!-- doxytag: member="Async::AudioIO::channel" ref="abef00b2a149a1465897fc27ddd5b3294" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Async::AudioIO::channel </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the audio channel used. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the audio channel that was given to the constructor </dd></dl>

<p>Definition at line <a class="el" href="AsyncAudioIO_8h_source.html#l00300">300</a> of file <a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>.</p>

</div>
</div>
<a class="anchor" id="a9b489517c73a42cc1c5a781736be5702"></a><!-- doxytag: member="Async::AudioIO::close" ref="a9b489517c73a42cc1c5a781736be5702" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::AudioIO::close </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Close the adio device. </p>

</div>
</div>
<a class="anchor" id="af680b696dba4a0ec6f76c886252aab6e"></a><!-- doxytag: member="Async::AudioIO::gain" ref="af680b696dba4a0ec6f76c886252aab6e" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float Async::AudioIO::gain </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the gain. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the gain </dd></dl>

<p>Definition at line <a class="el" href="AsyncAudioIO_8h_source.html#l00288">288</a> of file <a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>.</p>

</div>
</div>
<a class="anchor" id="a389e12cafc0ac9d7ba8c3836d7871051"></a><!-- doxytag: member="Async::AudioIO::isFullDuplexCapable" ref="a389e12cafc0ac9d7ba8c3836d7871051" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Async::AudioIO::isFullDuplexCapable </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check if the audio device is capable of full duplex operation. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Return <em>true</em> if the device is capable of full duplex or <em>false</em> if it is not </dd></dl>

</div>
</div>
<a class="anchor" id="a8ed7982564e5a558915cced8ae70d2bc"></a><!-- doxytag: member="Async::AudioIO::mode" ref="a8ed7982564e5a558915cced8ae70d2bc" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529">Mode</a> Async::AudioIO::mode </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Find out how many samples there are in the output buffer. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the number of samples in the output buffer on success or -1 on failure.</dd></dl>
<p>This function can be used to find out how many samples there are in the output buffer at the moment. This can for example be used to find out how long it will take before the output buffer has been flushed. </p>

<p>Definition at line <a class="el" href="AsyncAudioIO_8h_source.html#l00271">271</a> of file <a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>.</p>

</div>
</div>
<a class="anchor" id="a60aa4a111385aeea9e3142a6670fe859"></a><!-- doxytag: member="Async::AudioIO::open" ref="a60aa4a111385aeea9e3142a6670fe859" args="(Mode mode)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Async::AudioIO::open </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529">Mode</a>&nbsp;</td>
          <td class="paramname"> <em>mode</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Open the audio device in the specified mode. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>mode</em>&nbsp;</td><td>The mode to open the audio device in. See <a class="el" href="classAsync_1_1AudioIO.html#a89b25e780078902fbfc25383b2877529" title="The different modes to open a device in.">Async::AudioIO::Mode</a> for more information </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns <em>true</em> on success or else <em>false</em> on failure </dd></dl>

</div>
</div>
<a class="anchor" id="a7c48d73409ebd957a0c04a85b37e73bd"></a><!-- doxytag: member="Async::AudioIO::resumeOutput" ref="a7c48d73409ebd957a0c04a85b37e73bd" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::AudioIO::resumeOutput </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Resume audio output to the sink. </p>
<p>This function will be called when the registered audio sink is ready to accept more samples. This function is normally only called from a connected sink object. </p>

<p>Reimplemented from <a class="el" href="classAsync_1_1AudioSource.html#ac187f89a6094ec066dab5b4fd3108754">Async::AudioSource</a>.</p>

<p>Definition at line <a class="el" href="AsyncAudioIO_8h_source.html#l00309">309</a> of file <a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>.</p>

</div>
</div>
<a class="anchor" id="aaf3c934faa7ac41578edaaf2d506fafb"></a><!-- doxytag: member="Async::AudioIO::sampleRate" ref="aaf3c934faa7ac41578edaaf2d506fafb" args="(void) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Async::AudioIO::sampleRate </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the sample rate. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the sample rate </dd></dl>

<p>Definition at line <a class="el" href="AsyncAudioIO_8h_source.html#l00294">294</a> of file <a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>.</p>

</div>
</div>
<a class="anchor" id="a978686e3209d019fddd8e4ea860a9748"></a><!-- doxytag: member="Async::AudioIO::setBlocksize" ref="a978686e3209d019fddd8e4ea860a9748" args="(int size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static int Async::AudioIO::setBlocksize </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the blocksize used when opening audio devices. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>The blocksize, in samples per channel, to use </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the blocksize actually set</dd></dl>
<p>Use this function to set the block size used when opening audio devices. The block size is the size of the blocks used when reading and writing audio to/from the sound card. Smaller blocks give less delay but could cause choppy audio if the computer is too slow. The blocksize is set as samples per channel. For example, a blocksize of 256 samples at 8kHz sample rate will give a delay of 256/8000 = 32ms. This is a global setting so all sound cards will be affected. Already opened sound cards will not be affected. </p>

</div>
</div>
<a class="anchor" id="a58f08f10ac4973c4aba902a50e64f181"></a><!-- doxytag: member="Async::AudioIO::setBufferCount" ref="a58f08f10ac4973c4aba902a50e64f181" args="(int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static int Async::AudioIO::setBufferCount </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>count</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the buffer count used when opening audio devices. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>The buffer count to use </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Returns the buffer count actually set</dd></dl>
<p>Use this function to set the buffer count used when opening audio devices. The buffer count is the maximum number of blocks the driver will buffer when reading and writing audio to/from the sound card. Lower numbers give less delay but could cause choppy audio if the computer is too slow. This is a global setting so all sound cards will be affected. Already opened sound cards will not be affected. </p>

</div>
</div>
<a class="anchor" id="a728c8d8eb10d34b782c0b8fa52102efc"></a><!-- doxytag: member="Async::AudioIO::setChannels" ref="a728c8d8eb10d34b782c0b8fa52102efc" args="(int channels)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void Async::AudioIO::setChannels </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>channels</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the number of channels used when doing future opens. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>channels</em>&nbsp;</td><td>The number of channels to use</td></tr>
  </table>
  </dd>
</dl>
<p>Use this function to set the number of channels used when opening audio devices. This is a global setting so all sound cards will be affected. Already opened sound cards will not be affected. </p>

</div>
</div>
<a class="anchor" id="abf44bb0d6148b7c8bf0376ec200d1d2c"></a><!-- doxytag: member="Async::AudioIO::setGain" ref="abf44bb0d6148b7c8bf0376ec200d1d2c" args="(float gain)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Async::AudioIO::setGain </td>
          <td>(</td>
          <td class="paramtype">float&nbsp;</td>
          <td class="paramname"> <em>gain</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the gain to use. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>gain</em>&nbsp;</td><td>The new gain to set</td></tr>
  </table>
  </dd>
</dl>
<p>This function will setup the gain to use for this audio stream. The default gain is 1.0, that is no amplification or attenuation. A value &lt; 1.0 will attenuate the audio stream and a value &gt; 1.0 will result in an amplification of the audio stream. </p>

<p>Definition at line <a class="el" href="AsyncAudioIO_8h_source.html#l00282">282</a> of file <a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad9512b57c7509bdf7ba79279313a9013"></a><!-- doxytag: member="Async::AudioIO::setSampleRate" ref="ad9512b57c7509bdf7ba79279313a9013" args="(int rate)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void Async::AudioIO::setSampleRate </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>rate</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the sample rate used when doing future opens. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>rate</em>&nbsp;</td><td>The sampling rate to use</td></tr>
  </table>
  </dd>
</dl>
<p>Use this function to set the sample rate used when opening audio devices. This is a global setting so all sound cards will be affected. Already opened sound cards will not be affected. </p>

</div>
</div>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="a8fbf9b3017983991713e2cbb819dfd5a"></a><!-- doxytag: member="Async::AudioIO::AudioDevice" ref="a8fbf9b3017983991713e2cbb819dfd5a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">friend class AudioDevice<code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="AsyncAudioIO_8h_source.html#l00356">356</a> of file <a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="AsyncAudioIO_8h_source.html">AsyncAudioIO.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address>
</body>
</html>