Table of Contents
audio_capture_close
Closes an audio capture session.
Description
The audio_capture_close function closes an audio capture session, releasing any allocated resources associated with the session. Once the audio capture session has been closed, the handle is no longer valid and may not be used.
Prototype
t_error audio_capture_close(t_audio_capture capture);
Parameters
t_audio_capture capture
A handle to the audio capture session, as returned by audio_capture_open.
Return value
The return value is 0 if the audio capture session is closed successfully. Otherwise a negative
error code is returned. Error codes are
defined in quanser_errors.h
. A suitable error message
may be retrieved using msg_get_error_message.
Error codes
QERR_INVALID_ARGUMENT
An invalid capture session was passed as an argument. Once a capture session has been closed using audio_capture_close the session handle is invalid.
Requirements
Include Files |
Libraries |
---|---|
quanser_audio.h |
quanser_media.lib;quanser_runtime.lib;quanser_common.lib |
Examples
t_audio_capture capture; t_error result = audio_capture_open("audio://localhost:0", 44100, NUM_CHANNELS, AUDIO_FORMAT_FLOAT, 4410, AUDIO_CAPTURE_MODE_ONCE_AT_OPEN, &capture); if (result >= 0) { ... audio_capture_close(capture); } else { TCHAR message[512]; msg_get_error_message(NULL, result, message, sizeof(message)); _tprintf(_T("Failed to open audio capture session. %s (error %d)\n"), message, -result); }
See Also
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.