This file is indexed.

/usr/share/doc/portaudio19-doc/doc/html/start_stop_abort.html is in portaudio19-doc 19+svn20140130-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>PortAudio: Starting, Stopping and Aborting a Stream</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">PortAudio
   &#160;<span id="projectnumber">2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Starting, Stopping and Aborting a Stream </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="tut_startstop1"></a>
Starting, Stopping and Aborting a Stream</h1>
<p>PortAudio will not start playing back audio until you start the stream. After calling <a class="el" href="portaudio_8h.html#a7432aadd26c40452da12fa99fc1a047b">Pa_StartStream()</a>, PortAudio will start calling your callback function to perform the audio processing.</p>
<div class="fragment"><div class="line">err = <a class="code" href="portaudio_8h.html#a7432aadd26c40452da12fa99fc1a047b">Pa_StartStream</a>( stream );</div>
<div class="line"><span class="keywordflow">if</span>( err != paNoError ) <span class="keywordflow">goto</span> error;</div>
</div><!-- fragment --><p>You can communicate with your callback routine through the data structure you passed in on the open call, or through global variables, or using other interprocess communication techniques, but please be aware that your callback function may be called at interrupt time when your foreground process is least expecting it. So avoid sharing complex data structures that are easily corrupted like double linked lists, and avoid using locks such as mutexs as this may cause your callback function to block and therefore drop audio. Such techniques may even cause deadlock on some platforms.</p>
<p>PortAudio will continue to call your callback and process audio until you stop the stream. This can be done in one of several ways, but, before we do so, we'll want to see that some of our audio gets processed by sleeping for a few seconds. This is easy to do with <a class="el" href="portaudio_8h.html#a1b3c20044c9401c42add29475636e83d">Pa_Sleep()</a>, which is used by many of the examples in the patests/ directory for exactly this purpose. Note that, for a variety of reasons, you can not rely on this function for accurate scheduling, so your stream may not run for exactly the same amount of time as you expect, but it's good enough for our example.</p>
<div class="fragment"><div class="line"><span class="comment">/* Sleep for several seconds. */</span></div>
<div class="line"><a class="code" href="portaudio_8h.html#a1b3c20044c9401c42add29475636e83d">Pa_Sleep</a>(NUM_SECONDS*1000);</div>
</div><!-- fragment --><p>Now we need to stop playback. There are several ways to do this, the simplest of which is to call <a class="el" href="portaudio_8h.html#af18dd60220251286c337631a855e38a0">Pa_StopStream()</a>:</p>
<div class="fragment"><div class="line">err = <a class="code" href="portaudio_8h.html#af18dd60220251286c337631a855e38a0">Pa_StopStream</a>( stream );</div>
<div class="line"><span class="keywordflow">if</span>( err != paNoError ) <span class="keywordflow">goto</span> error;</div>
</div><!-- fragment --><p><a class="el" href="portaudio_8h.html#af18dd60220251286c337631a855e38a0">Pa_StopStream()</a> is designed to make sure that the buffers you've processed in your callback are all played, which may cause some delay. Alternatively, you could call <a class="el" href="portaudio_8h.html#a138e57abde4e833c457b64895f638a25">Pa_AbortStream()</a>. On some platforms, aborting the stream is much faster and may cause some data processed by your callback not to be played.</p>
<p>Another way to stop the stream is to return either paComplete, or paAbort from your callback. paComplete ensures that the last buffer is played whereas paAbort stops the stream as soon as possible. If you stop the stream using this technique, you will need to call <a class="el" href="portaudio_8h.html#af18dd60220251286c337631a855e38a0">Pa_StopStream()</a> before starting the stream again.</p>
<p>Previous: <a class="el" href="open_default_stream.html">Opening a Stream Using Defaults</a> | Next: <a class="el" href="terminating_portaudio.html">Closing a Stream and Terminating PortAudio</a> </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Feb 15 2014 23:28:26 for PortAudio by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>