-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement audio file decoding support on Android using MediaCodec #86
Comments
I tried the development build on my device (Android 13 using Processing 4.2) and the sketch is stuck building indefinitely with the following error in the console:
The sample sketch I'm using is the same test code from #70. Perhaps I may have missed something? (I was also having issues trying to update the Android SDK earlier, though I'd like to think that isn't related) |
Thanks so much for the swift feedback! Yeah not really sure what to make of this error message, maybe @codeanticode has an idea? Either way I will try running it on a pristine Android mode setup myself when I get around to it, hopefully before the end of the month. |
I get the same error on a fresh Android mode install, looks like it is a general problem with libraries that bundle any native libraries: processing/processing-android#738 When removing all native library directories, you get the following error instead:
Instead of trying to solve this inside the Android mode build process it might be easier to just create a separate Android release without any of the (anyway mostly unnecessary) bundled jars and native libraries.. |
@daniel-tran could I ask you to try running any example sketch (ideally one of the |
I've replaced the sound library with the one from the .zip file and the "SineWave" & "SimplePlayback" example sketches build successfully. However, they proceed to crash immediately when opened on my Android device with the following error logged in the console (this one is from the "SimplePlayback" sketch, though the core error is essentially the same for both examples):
Running the sketches in Java mode still seems to work. |
Thanks, that's really useful! If this is not getting boring for you yet, here would be an updated sound-android.zip to try out which should make it past that Exception. Hoping I'll manage to get Android mode up and running here to be able to test myself... |
The new .zip file works much better now and the "SineWave" & "SimplePlayback" example sketches don't crash anymore. |
To improve audio file format support on most platforms, starting with 0d8287d the
SoundFile
class uses the JavaSound system to decode audio files, which however does not exist on Android. In order to achieve the same format coverage as on full JavaSE platforms, a decoding routine mimicking the JavaSound one but based on the AndroidMediaCodec
class would have to be implemented.The basic support for 16 bit wavs and aiffs on Android is not affected by this change, however there is the chance that the SoundFile class in its current state will not even be run because of imports that are missing on Android. I would be super grateful if @codeanticode, @Calsign, @daniel-tran or other users with a running Android setup could take the current development build for a test ride and report back any issues?
(Once some proper unit tests have been added, it would also make sense to add a android-based test target to the Github deploy workflow.)
The text was updated successfully, but these errors were encountered: