In taking a break from the recording issue I’m having, I tried using AudioDeviceManager::createXmlState tonight and came across an issue which might be a bug. I think I may have also Identified the problem… Ideally, at my program shutdown I’d like to save whatever the AudioDeviceManager settings are set, and to try to reload them on next program launch. In the destructor of my maincomponent i attempt to write the AudioDeviceManagers settings…
ScopedPointer<XmlElement> saveAudioDeviceXmlElement(audioDeviceManager.createStateXml()); saveAudioDeviceXmlElement->writeToFile(File(File::getSpecialLocation(File::commonApplicationDataDirectory).getFullPathName() + "/FlipMu/Nuance/lastAudioConfig.xml"), String::empty, "UTF-8", 200);
When I close my app, I hit an error and the file never finishes being created (just an unfinished temp file). The debugger seems to be stuck on am empty string I think. I tried editing AudioDeviceManager and calling AudioDeviceManager::updateXml() at the end of AudioDeviceManager::initialise to ensure that the values were being stored, and that fixed it from crashing, however, the resulting xml is basically empty–
<?xml version="1.0" encoding="UTF-8"?> <DEVICESETUP deviceType="CoreAudio" audioOutputDeviceName="" audioInputDeviceName=""/>
If I open up an AudioDeviceSelectorComponent and change the audio input device, they input/output device names and samplerate get stored in the xml file properly, but not the enabled input/output channels. If I manually disable and re-enable those, they then get stored properly. Buffer-size never seems to store…
Just thought I’d give you a heads up in case its an actual bug and not some silly mistake on my part!