use of javax.sound.sampled.AudioInputStream in project lwjgl by LWJGL.
the class WaveDataTest method executeMidStreamCreationTest.
private void executeMidStreamCreationTest() {
try {
AudioInputStream ais = AudioSystem.getAudioInputStream(WaveDataTest.class.getClassLoader().getResource(filePath));
int totalSize = ais.getFormat().getChannels() * (int) ais.getFrameLength() * ais.getFormat().getSampleSizeInBits() / 8;
// skip 1/4 of the stream
int skip = totalSize / 4;
long skipped = ais.skip(skip);
WaveData wd = WaveData.create(ais);
if (wd == null) {
System.out.println("executeMidStreamCreationTest::success");
}
} catch (Exception e) {
e.printStackTrace();
}
}
use of javax.sound.sampled.AudioInputStream in project lwjgl by LWJGL.
the class WaveDataTest method executeStreamCreationTest.
private void executeStreamCreationTest() {
try {
AudioInputStream ais = AudioSystem.getAudioInputStream(new File(filePath));
WaveData wd = WaveData.create(ais);
if (wd == null) {
System.out.println("executeMidStreamCreationTest::success");
}
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations