< prev index next >
test/javax/sound/sampled/spi/AudioFileReader/RecognizeHugeWaveExtFiles.java
Print this page
*** 123,133 ****
/**
* Tests the {@code AudioInputStream} fetched from the fake header.
* <p>
* Note that the frameLength is stored as long which means that {@code
! * AudioInputStream} must store all possible data from au file.
*/
private static void testAIS(final int[] type, final int rate,
final int channel, final long size)
throws Exception {
final byte[] header = createHeader(type, rate, channel, size);
--- 123,133 ----
/**
* Tests the {@code AudioInputStream} fetched from the fake header.
* <p>
* Note that the frameLength is stored as long which means that {@code
! * AudioInputStream} must store all possible data from wave file.
*/
private static void testAIS(final int[] type, final int rate,
final int channel, final long size)
throws Exception {
final byte[] header = createHeader(type, rate, channel, size);
*** 164,175 ****
if (format.getChannels() != channel) {
System.err.println("Expected: " + channel);
System.err.println("Actual: " + format.getChannels());
throw new RuntimeException();
}
! if (format.getFrameSize() != ((bits + 7) / 8) * channel) {
! System.err.println("Expected: " + (bits * channel + 1) / 8);
System.err.println("Actual: " + format.getFrameSize());
throw new RuntimeException();
}
}
--- 164,176 ----
if (format.getChannels() != channel) {
System.err.println("Expected: " + channel);
System.err.println("Actual: " + format.getChannels());
throw new RuntimeException();
}
! int frameSize = ((bits + 7) / 8) * channel;
! if (format.getFrameSize() != frameSize) {
! System.err.println("Expected: " + frameSize);
System.err.println("Actual: " + format.getFrameSize());
throw new RuntimeException();
}
}
< prev index next >