Initialise() method for AudioDeviceManager showing error


#1

Hi jules,
I am working on a c++ dll that is based on juce library.I have to use this dll in c#.When i am creating object for audiodevicemanager using new operator and then calling initialise() method, application is crashing.I am working on window platform with Latest juce library JUCE 2.0.
My code is like this:
within constructor
audioDeviceManager = new AudioDeviceManager();
audioDeviceManager->initialise(0,2,0,true);

audioDeviceManager is private member of the class.

Please help me.


#2

Sorry, my psychic powers aren’t strong enough to magically tell you what you’ve done wrong. But your debugger probably could.


#3

Hi jules,
Sorry i know its stupid question .Actually i just want to know after creating AudioDeviceManager object using new operator how to set the output and input device without using initialise() method .I want to initialise output device and input device to default device.


#4

Just use setAudioDeviceSetup(). This is all pretty well explained in the docs, isn’t it?


#5

hi Jules,
this is my code

audioDeviceManager = new AudioDeviceManager(); AudioDeviceManager::AudioDeviceSetup config; audioDeviceManager->getAudioDeviceSetup(config); config.outputDeviceName = String::empty; config.inputDeviceName = String::empty; config.sampleRate = 0; config.bufferSize = 0; config.useDefaultInputChannels = true; config.useDefaultOutputChannels = true; audioDeviceManager->setAudioDeviceSetup(config,true);
now after this when i try to get current audio device using :
AudioIODevice* dev = audioDeviceManager->getCurrentAudioDevice();

i get dev as null which means current device is not set…what to do…please help