I'm trying to get a simple patch (just for the sake of learning) to work in Android. So I tried:
int sampleRate= AudioParameters.suggestSampleRate();
PdAudio.initAudio(sampleRate, 0, 2, 8, true);
and I get:
"W/AudioParameters: Initializing audio parameters with null context on Android 4.2 or later."
I've tried changing the sample rate and I still get the same message. Ideas?
-
Android audio parameters.
-
@MDobleZ I don't know, but it looks like there is some useful script here......
https://github.com/tsnobip/MagnetPD/blob/master/libs/pureData/org/puredata/android/io/AudioParameters.java
And in MagnetPD generally.
David. -
@whale-av said:
MagnetPD
Yeah, I've seen that code, but I haven't found it useful really. I think the problem is the sample rate, but changing it doesn't do anything.
-
@MDobleZ Ah!. I understand the sample rate is fixed at 48K but from Nougat onwards you can change it in all of the following files......
a2dp_audio_policy_configurations.xml
audio.policy.conf
audio.policy.configuration.xml
r_submix_audio_policy_configurations.xml
usb_audio_policy_configuration.xmlNormally all files are resampled to 48K..... bit depth?
Will Android resample if only some of those files are set to a different sample rate?
Or will you end up with a total mess?
But some devices still only use the .conf file as was the case before Nougat.
David. -
Reading a bit further, I found "couldn't find "libpd.so"" in the list.
-
I've solved it by adding:
ndk {
abiFilters "armeabi"
}
to my build.gradle(module:app)