Closed jyg closed 1 year ago
I have no idea as I have not developed for Android. Probably ask @cuinjune or @cerupcat who have.
Hi, I succeeded in building the pdExample of ofxPd (OF 11.0) with Android Studio 4.1.2.
Hi, sorry for bothering you with my question but did you have any issues with the C compiler? I'm using the same OF and AS version but I cannot build while using ofxPd
Thanks
Apologies, I'm super bogged down with work right now.
Unfortunately, I've been using a pretty hacked-up version of OF/Libpd for Android since I've had a lot of Android audio issues (that still aren't quite stable).
I don't have anything that's easily shareable right now. Ultimately, I decided to not use OpenFrameworks AudioStreams since they had issues with things like background audio being choppy and went with using Oboe (https://github.com/google/oboe) which involved changing OFs build system as well (since Oboe's minimum requirements weren't supported by OF).
That isn't to say the latest OF wouldn't work though. I'm on a fairly old version.
@mnlvqz
Hi, sorry for bothering you with my question but did you have any issues with the C compiler? I'm using the same OF and AS version but I cannot build while using ofxPd
Hi, I had to modify some #include lines in libpd and pd sources, specifying relative paths more explicitly so that the compiler could find the resources.
@cerupcat Thanks for your answer. Indeed, the use of ofSoundStreamSetup
is problematic. I have to try the solution proposed here, but even with nb of inputs = 0, the app sounds glitchy when pressing home button
I'd suggest checking on the main OF repo for an issue on ofSoundStream & Android as this is a general issue with OF and less ofxPd which only uses ofSoundStream.
Another approach is to use something like Oboe directly without bothering with ofSoundStream, then I don't think there is a need for any hacking if you are only using Oboe + libpd. The ofxPd wrapper itself doesn't use ofSoundStream except via the audio sample callbacks, but you can call those yourself via another audio API.
@danomatika Thanks for your suggestion. I'll try to use another audio API. I need to use OF and ofxPd, since I want to include a pd external in my project, and as I'm a beginner with Java / Android.
the use of
ofSoundStreamSetup
is problematic. I have to try the solution proposed here, but even with nb of inputs = 0, the app sounds glitchy when pressing home button
Home button issue solved : by following the solution proposed here (editing the manifest.xml file) AND by adding a line of code in ofApp.c, inside ofApp::setup() function : ofxAndroidRequestPermission(OFX_ANDROID_PERMISSION_RECORD_AUDIO);
ofSoundStream works fine.
Ok cool. Feel free to make a small PR adding info about this to the readme, perhaps in an Android-specific section.
Closing for now.
Hi, I succeeded in building the pdExample of ofxPd (OF 11.0) with Android Studio 4.1.2. Is it possible to get the sound non interrupted when I want to switch to another application, by allowing background audio ? At the moment, when I press the 'Recent' button, the sound stops and android says that the pdExample does not respond. What did I miss ? Thanks