CAudioInfo audioInfo = __generate_audio_input_info(sample_rate, channel, type);
handle->audioIoHandle = new CAudioInput(audioInfo);
- if (handle == NULL) {
+ if (handle->audioIoHandle == NULL) {
THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed allocation internal handle");
}
CAudioInfo audioInfo = __generate_audio_input_loopback_info(sample_rate, channel, type);
handle->audioIoHandle = new CAudioInput(audioInfo);
- if (handle == NULL) {
+ if (handle->audioIoHandle == NULL) {
THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed allocation internal handle");
}
CAudioInfo audioInfo = __generate_audio_output_info(sample_rate, channel, type, SOUND_TYPE_MEDIA /* default sound_type */);
handle->audioIoHandle = new CAudioOutput(audioInfo);
- if (handle == NULL) {
+ if (handle->audioIoHandle == NULL) {
THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed allocation internal handle");
}