Closing a Stream and Terminating PortAudio

When you are done with a stream, you should close it to free up resources:

err = Pa_CloseStream( stream );
if( err != paNoError ) goto error;

We've already mentioned this in Initializing PortAudio, but in case you forgot, be sure to terminate PortAudio when you are done:

err = Pa_Terminate( );
if( err != paNoError ) goto error;

Previous: Starting, Stopping and Aborting a Stream | Next: Utility Functions