diff options
author | Guenter Geiger <ggeiger@users.sourceforge.net> | 2004-02-02 11:28:02 +0000 |
---|---|---|
committer | Guenter Geiger <ggeiger@users.sourceforge.net> | 2004-02-02 11:28:02 +0000 |
commit | ae6b5d89ea93b95c2990895077cf5e8f0bba9ad9 (patch) | |
tree | 1e7570f11ac688e94342968e90301c4684e61193 /pd/portaudio_v18/docs/pa_tut_open.html | |
parent | f26399eba6ee6ce9eb7bae9a4b60a90dc2ebca94 (diff) |
This commit was generated by cvs2svn to compensate for changes in r1301,
which included commits to RCS files with non-trunk default branches.
svn path=/trunk/; revision=1302
Diffstat (limited to 'pd/portaudio_v18/docs/pa_tut_open.html')
-rw-r--r-- | pd/portaudio_v18/docs/pa_tut_open.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/pd/portaudio_v18/docs/pa_tut_open.html b/pd/portaudio_v18/docs/pa_tut_open.html new file mode 100644 index 00000000..12772811 --- /dev/null +++ b/pd/portaudio_v18/docs/pa_tut_open.html @@ -0,0 +1,56 @@ +<!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.79 [en] (Windows NT 5.0; 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> + +<center><table COLS=1 WIDTH="100%" BGCOLOR="#FADA7A" > +<tr> +<td> +<center> +<h1> +PortAudio Tutorial</h1></center> +</td> +</tr> +</table></center> + +<h2> +Opening a Stream using Defaults</h2> + +<blockquote>The next step is to open a stream which is similar to opening +a file. You can specify whether you want audio input and/or output, how +many channels, the data format, sample rate, etc. +<p>First declare a variable to receive the stream pointer: +<blockquote> +<pre>PortAudioStream *stream;</pre> +</blockquote> +There are two calls for opening streams, <tt>Pa_OpenStream</tt>() and <tt>Pa_OpenDefaultStream</tt>(). +P<tt>a_OpenStream()</tt> takes extra parameters which give you more +control. You can normally just use <tt>Pa_OpenDefaultStream</tt>() which +just calls <tt>Pa_OpenStream()</tt> <tt>with</tt> some reasonable default +values. Let's open a stream for stereo output, using floating point +data, at 44100 Hz. +<blockquote> +<pre>err = Pa_OpenDefaultStream( + &stream, /* passes back stream pointer */ + 0, /* no input channels */ + 2, /* stereo output */ + paFloat32, /* 32 bit floating point output */ + 44100, /* sample rate */ + 256, /* frames per buffer */ + 0, /* number of buffers, if zero then use default minimum */ + patestCallback, /* specify our custom callback */ + &data ); /* pass our data through to callback */</pre> +</blockquote> +If you want to use 16 bit integer data, pass <tt>paInt16</tt> instead of +<tt>paFloat32</tt>.</blockquote> +<font size=+2><a href="http://www.portaudio.com/">home</a> | <a href="pa_tutorial.html">contents</a> +| <a href="pa_tut_init.html">previous</a> | <a href="pa_tut_run.html">next</a></font> +</body> +</html> |