audio_render_write End of trail navigation bar

Table of Contents

audio_render_close

Closes an audio render session.

Description

The audio_render_close function closes an audio render session, releasing any allocated resources associated with the session. Once the audio render session has been closed, the handle is no longer valid and may not be used.

Prototype

t_error
audio_render_close(t_audio_render render);
    

Parameters

t_audio_render render

A handle to the audio render session, as returned by audio_render_open.

Return value

The return value is 0 if the audio render 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 render session was passed as an argument. Once a render session has been closed using audio_render_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_render render;
t_error result = audio_render_open("audio://localhost:3", 44100, NUM_CHANNELS, AUDIO_FORMAT_FLOAT, 44100, &render);
if (result >= 0) {
    ...
    audio_render_close(render);
} else {
    TCHAR message[512];
    msg_get_error_message(NULL, result, message, sizeof(message));
    _tprintf(_T("Failed to open audio render session. %s (error %d)\n"), message, -result);
}
    

See Also

 

navigation bar