fixed and cleaned code up

This commit is contained in:
2017-05-28 17:30:35 -05:00
parent b4a6bbbea3
commit a52e5fc0ed
12 changed files with 53 additions and 38 deletions

View File

@@ -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;
}
}

View File

@@ -46,7 +46,7 @@ public class AudioInfo implements Disposable {
e.printStackTrace();
}
invalidMusic = true;
// invalidMusic = true;
} else {

View File

@@ -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();

View File

@@ -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
}
}