1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00
audacity/lib-src/portaudio/docs/pa_tut_over.html

87 lines
2.9 KiB
HTML

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.77 [en]C-gatewaynet (Win98; U) [Netscape]">
<meta name="Author" content="Phil Burk">
<meta name="Description" content="Tutorial for PortAudio, a cross platform, open-source, audio I/O library.It provides a very simple API for recording and/or playing sound using a simple callback function.">
<meta name="KeyWords" content="audio, tutorial, library, portable, open-source, DirectSound,sound, music, JSyn, synthesis,">
<title>PortAudio Tutorial</title>
</head>
<body>
&nbsp;
<center><table COLS=1 WIDTH="100%" BGCOLOR="#FADA7A" >
<tr>
<td>
<center>
<h1>
PortAudio Tutorial</h1></center>
</td>
</tr>
</table></center>
<h2>
Overview of PortAudio</h2>
<blockquote>PortAudio is a library that provides streaming audio input
and output. It is a cross-platform API (Application Programming Interface)
that works on Windows and Macintosh, and perhaps other platforms by the
time you read this. This means that you can write a simple 'C' program
to process or generate an audio signal, and that program can run on several
different computers just by recompiling the source code.
<p>Here are the steps to writing a PortAudio application:
<ol>
<li>
Write a callback function that will be called by PortAudio when audio processing
is needed.</li>
<li>
Initialize the PA library and open a stream for audio I/O.</li>
<li>
Start the stream. Your callback function will be now be called repeatedly
by PA in the background.</li>
<li>
In your callback you can read audio data from the inputBuffer and/or write
data to the outputBuffer.</li>
<li>
Stop the stream by returning 1 from your callback, or by calling a stop
function.</li>
<li>
Close the stream and terminate the library.</li>
</ol>
</blockquote>
<blockquote>There is also <a href="pa_tut_rw.html">another interface</a>
provided that allows you to generate audio in the foreground. You then
simply write data to the stream and the tool will not return until it is
ready to accept more data. This interface is simpler to use but is usually
not preferred for large applications because it requires that you launch
a thread to perform the synthesis. Launching a thread may be difficult
on non-multi-tasking systems such as the Macintosh prior to MacOS X.
<p>Let's continue by building a simple application that will play a sawtooth
wave.
<p>Please select the page for the implementation you would like to use:
<ul>
<li>
<a href="pa_tut_pc.html">Windows (WMME or DirectSound)</a></li>
<li>
<a href="pa_tut_mac.html">Macintosh SoundManager</a></li>
<li>
<a href="pa_tut_asio.html">ASIO on Windows or Macintosh</a></li>
<li>
<a href="pa_tut_oss.html">Unix OSS</a></li>
</ul>
</blockquote>
<font size=+2><a href="http://www.portaudio.com/">home</a> |
<a href="pa_tutorial.html">contents</a>
| <a href="pa_tutorial.html">previous</a></font>
</body>
</html>