We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Help Me!I use Processing Minim to play Map3 files in Android, but I reported the following error:
11-07 17:12:15.540: I/System.out(28177): ==== JavaSound Minim Error ====
11-07 17:12:15.540: I/System.out(28177): ==== Unable to return a SourceDataLine: unsupported format - PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian
11-07 17:12:15.540: I/System.out(28177): === Minim Error ===
11-07 17:12:15.540: I/System.out(28177): === Couldn't load the file jingle.mp3
I wrote the code just like this :
minim = new Minim(this);
jingle = minim.loadFile("jingle.mp3", 2048);
Answers
please don't post duplicates. and don't post pictures of code.
maybe try another file? the error suggests it doesn't like the one you have.
this question suggests you have bigger problems:
https://forum.processing.org/two/discussion/7643/does-minim-work-on-android-how-could-you-test-a-sketch-that-uses-minim-in-android-mode
but things may've changed since 2014
@zishu===
minim does not work with android as it is based on javaFxSound; use the android mediaplayer API to play sound.
Additional information on Minim alternatives for Android:
It took me too long to figure this out, but if you need the FFT functionality of Minim, Android includes a built-in
Visualizer
class (https://developer.android.com/reference/android/media/audiofx/Visualizer.html) with a straightforwardgetFft()
method. Rather than playing media, it gives you FFT data straight from the currently playing audio on the device. It's pretty lightweight and can be extended easily. Values come as abyte[]
array and are scaled between -128 and 128.