Audio playback without any devices?


#1

Obviously the topic isn’t possible, but I’ve got a Component that acts like that. Here’s the code:[code]class HelloWorldContentComponent : public Component
{
int freq;
AudioDeviceManager adm;
ToneGeneratorAudioSource tone;
AudioSourcePlayer player;
AudioDeviceSelectorComponent selector;
public:
HelloWorldContentComponent() : selector(adm, 0,2,0,2,false)
{
addAndMakeVisible(&selector);
freq = 440;
tone.setAmplitude(.5f);
tone.setFrequency(freq);
player.setSource(&tone);
adm.setAudioCallback(&player);
adm.initialise(0,2,0,false);
}

… the rest omitted because it’s irrelevant.[/code]

So anyway, I get audio with this component, but the device selector component shows “<< No Audio Device >>”. The drop down doesn’t list any other devices. Sample rate and block size can be changed however. What’s going on here?

I’m running a MacBook in Boot Camp, with the built-in Sigmatel audio. I have ASIO4ALL installed, but Juce is not configured with ASIO support.


#2

Sounds like a bug - are you running 1.43? I fixed a couple of things in the device selector for this version.


#3

I should have thought about this before, but the device selector is being passed an uninitialised device manager. Making the selector a pointer and creating it after the call to initialise fixes the problem. Doh.


#4