Hi,
Yes, this is a restriction added in Android API Level 23 which we now added support for.
Let me explain. In the world of Android M, it's not enough anymore to specify the permission in the manifest. If you compile your app for API Level 23 or higher, you now additinally have to explicitly request that permission at runtime, otherwise Android won't let you use audio inputs. That assert you hit—I just added it to make sure that everyone notices the new way of doing things, instead of wondering why their app's audio input doesn't work on Android M.
Here's how it works:
Instead of
audioDeviceManager->initialise (2, 2, 0, true, String(), 0);
you now have to write this:
RuntimePermissions::request (
RuntimePermissions::recordAudio,
/* >> callback to be called when Android decides to grant you the permissions << */
);
The callback will be called asynchronously. Sorry, that's an Android restriction, because what happens between the request and the callback is that Android will present this dialogue to the user:
The callback is a function with this signature: void callback (bool permissionWasGranted) { ... } When called, the argument tells you what the user chose, and then you have to react to that, such as actually initialising your audio device manager. The easiest way to achieve this in code is with a lambda, for example like this:
RuntimePermissions::request (
RuntimePermissions::recordAudio,
[] (bool wasGranted) {
int numInputChannels = wasGranted ? 2 : 0;
sharedAudioDeviceManager->initialise (numInputChannels, 2, 0, true, String(), 0);
}
);
Read the documentation of RuntimePermissions for more info. If it's still unclear, please post...