Audio Application cannot run

error has triggered a breakpoint

Try different channel counts with the setAudioChannels call. Is it 2 ins and 2 outs currently? Maybe your hardware or driver doesn’t support that.

I do not understand. I am new learn JUCE. Where should I set the setAudioChannels?
sorry, i use Google translate

setAudioChannels is a function (probably) located in the constructor of MainComponent.

If it doesn’t exist, alternatively look for an AudioDeviceManager class. It has two functions, initialise and initialiseWithDefaultDevices (prefer initialiseWithDefaultDevices for simplicity’s sake). The documentation I have linked to will tell you how to use it.

yes, it has setAudioChannels, what do I do now?

You might want to read the content of that audioError message which triggers the assertion. Something like The input and output ..., maybe this will give some clues about what’s going wrong.

Try with setAudioChannels (0, 2) and if it still doesn’t work setAudioChannels (0, 1).

But danielrudrich is right, we don’t know anything about the nature of your error, or the code you are trying to run. Is this the default projucer code from an Audio Application? Have you modified it in any way? Which version of JUCE are you running?

Yes, it’s the default code, I haven’t added or edited it yet, I just want to check if it works

I edited setAudioChannels (0, 2) with setAudioChannels (0, 1) still doesn’t work :frowning:

JUCE version?

I quick search revealed this:


You could have figured it out, if you would have read the errorMessage :slight_smile:

Apparently, your input and output device don’t have the same samplerate. As this is just an assertion, you can simply continue your debugger, with the only downside of not having audio. However, you should be able to open the device settings, and choose an input and output device which have indeed the same samplerate.

1 Like

@danielrudrich
Yes, I took off the earpiece and it worked, I plugged it in and it didn’t work

@arifd i use version 5.4.3