Issues with WhiteNoiseGenerator (NO AUDIO OUT)

Hi guys, i have a problem!

I followed the tutorial about the WhiteNoiseGenerator.
At the end i’ve compiled and launched application, but it don’t make any sound.
Some advice?

P.S. my version of JUCE is the latest; the version used for tutorial is different, for example my Audio Application project create also .h file.

Opening the sound output may have failed or the audio is going to some output you don’t have connected to your monitoring. I don’t think the tutorials go into the details of how to change the outputs or even do any error handling. (They just assume opening the default device will work.)

Ok, thanks.
How can i fix this?

You can try adding something like this for testing purposes in the component constructor (edit :changed the code to instantiate the components on the stack) :

AudioDeviceSelectorComponent devcomp{ deviceManager,
        1,4,1,4,true,true,true,false };
    devcomp.setSize(500, 500);
    AlertWindow alert{ "Audio hardware","",AlertWindow::InfoIcon, this };
    alert.addButton("OK", 1);
    int r = alert.runModalLoop();

That should show an audio device configuration dialog, where you may be able to test different devices and settings. (The settings won’t be saved and recalled between runs of the application using just that, though.)

1 Like

Hey @Xenakios. Can’t help but noticed you using the heap there. Isn’t best practice to use the stack whenever possible?

Yes, but there probably was some additional complication with stack allocation why I had written the code like that. The code is not that great anyway, as it’s using a modal dialog when the application starts etc. But like I mentioned in my reply, it would just be for testing purposes.

edit : it’s actually a bit odd the AudioAppComponent doesn’t have a (properly implemented) convenience method to show the AudioDeviceSelectorComponent to begin with…

1 Like

It works!!!
Thank you, very very much.