// Ignore this description if the internal sample rate is out of range.
if (sampleRate < description.mSampleRateRange.mMinimum || sampleRate > description.mSampleRateRange.mMaximum) {
continue;
}
mal_format format;
result = mal_format_from_AudioStreamBasicDescription(&description.mFormat, &format);
if (result != MAL_SUCCESS) {
continue;
}
*pFormatOut = format;
break;
}
mal_free(pStreamDescriptions);
if (*pFormatOut == mal_format_unknown) {
return MAL_FORMAT_NOT_SUPPORTED;
} else {
return MAL_SUCCESS;
}
}
mal_result mal_get_AudioObject_channel_layout(AudioObjectID deviceObjectID, mal_device_type deviceType, AudioChannelLayout** ppChannelLayout) // NOTE: Free the returned pointer with mal_free().
mal_result mal_get_AudioObject_channel_layout(AudioObjectID deviceObjectID, mal_device_type deviceType, AudioChannelLayout** ppChannelLayout) // NOTE: Free the returned pointer with mal_free().
for (mal_uint32 iBuffer = 0; iBuffer < pDevice->periods; ++iBuffer) {
status = AudioQueueAllocateBuffer((AudioQueueRef)pDevice->coreaudio.audioQueue, pThreadData->queueBufferSizeInBytes, (AudioQueueBufferRef*)&pDevice->coreaudio.audioQueueBuffers[iBuffer]);