summaryrefslogtreecommitdiff
path: root/portaudio/doc/src/tutorial/initializing_portaudio.dox
blob: 9439c350d6ba0f9f1155a5e0838f56fe7318fc97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** @page initializing_portaudio Initializing PortAudio
@ingroup tutorial

@section tut_init1 Initializing PortAudio

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.
@code
err = Pa_Initialize();
if( err != paNoError ) goto error;
@endcode

You can get a text message that explains the error message by passing it to Pa_GetErrorText( err ). For Example:

@code
printf(  "PortAudio error: %s\n", Pa_GetErrorText( err ) );
@endcode

It is also important, when you are done with PortAudio, to Terminate it:

@code
err = Pa_Terminate();
if( err != paNoError )
   printf(  "PortAudio error: %s\n", Pa_GetErrorText( err ) );
@endcode


Previous: \ref writing_a_callback | Next: \ref open_default_stream

*/