in AudioDeviceSelectorComponent:
When i change the Audio Device type from “Direct Sound” to "Asio"
and then change from one to another ASIO Device, it is possible that the currently used bufferSize doesn’t match the bufferSizes that are available and you will here noise!
I added something to the AudioDeviceSelectorComponent (look at //*****new, which checks this possibility and change the buffersize to a size which is currently supported)
[code] void comboBoxChanged (ComboBox* comboBoxThatHasChanged)
{
if (comboBoxThatHasChanged == 0)
return;
AudioDeviceManager::AudioDeviceSetup config;
setup.manager->getAudioDeviceSetup (config);
String error;
if (comboBoxThatHasChanged == outputDeviceDropDown
|| comboBoxThatHasChanged == inputDeviceDropDown)
{
if (outputDeviceDropDown != 0)
config.outputDeviceName = outputDeviceDropDown->getSelectedId() < 0 ? String::empty
: outputDeviceDropDown->getText();
if (inputDeviceDropDown != 0)
config.inputDeviceName = inputDeviceDropDown->getSelectedId() < 0 ? String::empty
: inputDeviceDropDown->getText();
if (! type->hasSeparateInputsAndOutputs())
config.inputDeviceName = config.outputDeviceName;
if (comboBoxThatHasChanged == inputDeviceDropDown)
config.useDefaultInputChannels = true;
else
config.useDefaultOutputChannels = true;
error = setup.manager->setAudioDeviceSetup (config, true);
//******** new
if (error.isEmpty())
{
int numBufferSizesAvailable=setup.manager->getCurrentAudioDevice()->getNumBufferSizesAvailable();
bool bufferSizeMatched=false;
for (int i=0 ; i<numBufferSizesAvailable; i++)
{
if (config.bufferSize == setup.manager->getCurrentAudioDevice()->getBufferSizeSamples (i))
{
bufferSizeMatched=true;
}
}
if ((!bufferSizeMatched) && (numBufferSizesAvailable>0))
{
config.bufferSize=setup.manager->getCurrentAudioDevice()->getBufferSizeSamples(numBufferSizesAvailable-1);
error = setup.manager->setAudioDeviceSetup (config, true);
}
}
//***********
showCorrectDeviceName (inputDeviceDropDown, true);
showCorrectDeviceName (outputDeviceDropDown, false);
updateControlPanelButton();
resized();
}
//etc.
[/code]