Created
October 1, 2012 15:27
-
-
Save JavaDeveloper/3812503 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Decoder extends Thread { | |
private static final String TAG = Decoder.class.getSimpleName(); | |
private AbstractTrackDecoder audioTrackDecoder; | |
private boolean running = true; | |
public Decoder(String path) { | |
audioTrackDecoder = new AudioTrackDecoder(path); | |
} | |
@Override | |
public void run() { | |
audioTrackDecoder.start(); | |
long startTime = System.nanoTime(); | |
while (running && audioTrackDecoder.hasOutputData) { | |
long t = (System.nanoTime() - startTime) / 1000; | |
audioTrackDecoder.systemTime(t); | |
} | |
audioTrackDecoder.cleanup(); | |
} | |
public void terminate() { | |
running = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment