From ae6b5d89ea93b95c2990895077cf5e8f0bba9ad9 Mon Sep 17 00:00:00 2001 From: Guenter Geiger Date: Mon, 2 Feb 2004 11:28:02 +0000 Subject: 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 --- pd/portaudio_v18/docs/pa_tut_open.html | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pd/portaudio_v18/docs/pa_tut_open.html (limited to 'pd/portaudio_v18/docs/pa_tut_open.html') 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 @@ + + + + + + + + + PortAudio Tutorial + + +  +
+ + + +
+
+

+PortAudio Tutorial

+
+ +

+Opening a Stream using Defaults

+ +
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. +

First declare a variable to receive the stream pointer: +

+
PortAudioStream   *stream;
+
+There are two calls for opening streams, Pa_OpenStream() and Pa_OpenDefaultStream(). +Pa_OpenStream() takes extra  parameters which give you more +control. You can normally just use Pa_OpenDefaultStream() which +just calls Pa_OpenStream() with some reasonable default +values.  Let's open a stream for stereo output, using floating point +data, at 44100 Hz. +
+
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 */
+
+If you want to use 16 bit integer data, pass paInt16 instead of +paFloat32.
+home | contents +| previousnext + + -- cgit v1.2.1