We are about to switch to a new forum software. Until then we have removed the registration on this forum.
There is this small code, i want to run in android mode. it gives a error saying : '' Dex: Error converting bytecode to dex: Cause: Dex cannot parse version 52 byte code. This is caused by library dependencies that have been compiled using Java 8 or above. If you are using the 'java' gradle plugin in a library submodule add targetCompatibility = '1.7' sourceCompatibility = '1.7' . "
This is the code:
import ddf.minim.*; import ddf.minim.analysis.*;
Minim minim; AudioPlayer song; FFT fft;
void setup() { size(512, 200); minim = new Minim(this); song = minim.loadFile("jingle.mp3", 512); song.play(); fft = new FFT(song.bufferSize(), song.sampleRate()); }
void draw() { background(0); fft.forward(song.mix); stroke(255, 0, 0, 128); for(int i = 0; i < fft.specSize(); i++) { line(i, height, i, height - fft.getBand(i)*4); }
stroke(255); for(int i = 0; i < song.bufferSize() - 1; i++) { line( i, 50 - song.left.get(i)50, i+1, 50 - song.left.get(i+1)50 ); line( i, 150 - song.right.get(i)50, i+1, 150 - song.right.get(i+1)50 ); }
}
Please help
Answers
I don't think minim will work in Android. If you want to play a sound file, you can do it using the cassette library. Also check previous posts: https://forum.processing.org/two/search?Search=mediaplayer
Also please check he sticky post in the forum to learn how to format your code in the forum: https://forum.processing.org/two/discussion/15473/readme-how-to-format-code-and-text#latest
Kf
I want to use the analysis library in minim Cassette doesn’t have that. So any other alternative??
@tilak===
for sound analysis + android see tarsos lib or (depending of your aims) also the damien da fede code for android fft. Yet your error code means that it is possible you have to change your gradle file as it is said (1.7 instead of 1.8)