fixed and cleaned code up
This commit is contained in:
@@ -104,7 +104,6 @@ public class AudioAnalyzer {
|
||||
seedDigit ++;
|
||||
}
|
||||
|
||||
|
||||
float fluxVal = 0;
|
||||
//bass detection
|
||||
fluxVal = 0;
|
||||
@@ -305,4 +304,8 @@ public class AudioAnalyzer {
|
||||
public void stop() {
|
||||
work = false;
|
||||
}
|
||||
|
||||
public int getPUID() {
|
||||
return PUID;
|
||||
}
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ public class AudioInfo implements Disposable {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
invalidMusic = true;
|
||||
// invalidMusic = true;
|
||||
|
||||
} else {
|
||||
|
||||
|
@@ -19,6 +19,9 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.audio.Music;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
|
||||
import javazoom.jl.decoder.Decoder;
|
||||
import javazoom.spi.mpeg.sampled.convert.DecodedMpegAudioInputStream;
|
||||
|
||||
public class Mp3AudioData implements AudioData {
|
||||
private int readWindowSize = 1024;
|
||||
|
||||
@@ -31,7 +34,10 @@ public class Mp3AudioData implements AudioData {
|
||||
private int sampleCount;
|
||||
|
||||
private AudioInputStream in;
|
||||
|
||||
|
||||
DecodedMpegAudioInputStream dStream;
|
||||
|
||||
Decoder decoder = new Decoder();
|
||||
public Mp3AudioData(FileHandle audioFile) {
|
||||
try {
|
||||
sampleCount = (int) new MP3File(audioFile.file()).getMP3AudioHeader().getNumberOfFrames();
|
||||
|
@@ -1,15 +1,17 @@
|
||||
package zero1hd.polyjet.audio;
|
||||
|
||||
import org.apache.commons.math3.random.MersenneTwister;
|
||||
|
||||
public class RhythmMapAlgorithm implements Runnable {
|
||||
AudioAnalyzer analyzer;
|
||||
|
||||
MersenneTwister rand;
|
||||
public RhythmMapAlgorithm(AudioAnalyzer analyzer) {
|
||||
this.analyzer = analyzer;
|
||||
rand = new MersenneTwister(analyzer.getPUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user