| 1 | <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 5 | <meta name="GENERATOR" content="Mozilla/4.73 [en]C-gatewaynet (Win98; U) [Netscape]"> |
| 6 | <meta name="Author" content="Phil Burk"> |
| 7 | <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."> |
| 8 | <meta name="KeyWords" content="audio, tutorial, library, portable, open-source, DirectSound,sound, music, JSyn, synthesis,"> |
| 9 | <title>PortAudio Tutorial</title> |
| 10 | </head> |
| 11 | <body> |
| 12 | |
| 13 | <center><table COLS=1 WIDTH="100%" BGCOLOR="#FADA7A" > |
| 14 | <tr> |
| 15 | <td> |
| 16 | <center> |
| 17 | <h1> |
| 18 | PortAudio Tutorial</h1></center> |
| 19 | </td> |
| 20 | </tr> |
| 21 | </table></center> |
| 22 | |
| 23 | <h2> |
| 24 | Initializing PortAudio</h2> |
| 25 | |
| 26 | <blockquote>Before making any other calls to PortAudio, you must call <tt>Pa_Initialize</tt>(). |
| 27 | This will trigger a scan of available devices which can be queried later. |
| 28 | Like most PA functions, it will return a result of type <tt>paError</tt>. |
| 29 | If the result is not <tt>paNoError</tt>, then an error has occurred. |
| 30 | <blockquote> |
| 31 | <pre>err = Pa_Initialize(); |
| 32 | if( err != paNoError ) goto error;</pre> |
| 33 | </blockquote> |
| 34 | You can get a text message that explains the error message by passing it |
| 35 | to |
| 36 | <blockquote> |
| 37 | <pre>printf( "PortAudio error: %s\n", Pa_GetErrorText( err ) );</pre> |
| 38 | </blockquote> |
| 39 | </blockquote> |
| 40 | <font size=+2><a href="http://www.portaudio.com/">home</a> | <a href="pa_tutorial.html">contents</a> |
| 41 | | <a href="pa_tut_callback.html">previous</a> | <a href="pa_tut_open.html">next</a></font> |
| 42 | </body> |
| 43 | </html> |