1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-07 04:10:08 +00:00

Workaround for CoreAudio devices that don't change sample rate correctly in 10.6; improvement to WASAPI error reporting

This commit is contained in:
Julian Storer 2009-10-01 14:30:06 +01:00
parent 687c08c939
commit b171ae8400
3 changed files with 124 additions and 174 deletions

View file

@ -599,7 +599,6 @@ public:
defaultBufferSize = jmax (inputDevice->defaultBufferSize, outputDevice->defaultBufferSize);
sampleRates = inputDevice->rates;
sampleRates.removeValuesNotIn (outputDevice->rates);
jassert (sampleRates.size() > 0); // in and out devices don't share any common sample rates!
}
else
{
@ -674,6 +673,12 @@ public:
close();
lastError = String::empty;
if (sampleRates.size() == 0 && inputDevice != 0 && outputDevice != 0)
{
lastError = "The input and output devices don't share a common sample rate!";
return lastError;
}
currentBufferSizeSamples = bufferSizeSamples <= 0 ? defaultBufferSize : jmax (bufferSizeSamples, minBufferSize);
currentSampleRate = sampleRate > 0 ? sampleRate : defaultSampleRate;