To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
The primary repository for this project is hosted at https://github.com/sonic-visualiser/sv-dependency-builds .
This repository is a read-only copy which is updated automatically every hour.
root / src / portaudio_20161030_catalina_patch / doc / src / tutorial / initializing_portaudio.dox @ 162:d43aab368df9
History | View | Annotate | Download (927 Bytes)
| 1 |
/** @page initializing_portaudio Initializing PortAudio |
|---|---|
| 2 |
@ingroup tutorial |
| 3 |
|
| 4 |
@section tut_init1 Initializing PortAudio |
| 5 |
|
| 6 |
Before making any other calls to PortAudio, you 'must' call Pa_Initialize(). This will trigger a scan of available devices which can be queried later. Like most PA functions, it will return a result of type paError. If the result is not paNoError, then an error has occurred. |
| 7 |
@code |
| 8 |
err = Pa_Initialize(); |
| 9 |
if( err != paNoError ) goto error; |
| 10 |
@endcode |
| 11 |
|
| 12 |
You can get a text message that explains the error message by passing it to Pa_GetErrorText( err ). For Example: |
| 13 |
|
| 14 |
@code |
| 15 |
printf( "PortAudio error: %s\n", Pa_GetErrorText( err ) ); |
| 16 |
@endcode |
| 17 |
|
| 18 |
It is also important, when you are done with PortAudio, to Terminate it: |
| 19 |
|
| 20 |
@code |
| 21 |
err = Pa_Terminate(); |
| 22 |
if( err != paNoError ) |
| 23 |
printf( "PortAudio error: %s\n", Pa_GetErrorText( err ) ); |
| 24 |
@endcode |
| 25 |
|
| 26 |
|
| 27 |
Previous: \ref writing_a_callback | Next: \ref open_default_stream |
| 28 |
|
| 29 |
*/ |