LWJGL Forum

Programming => OpenAL => Topic started by: cleo on June 23, 2012, 16:10:24

Title: OpenAL problem with Java 1.6.0_32 and higher
Post by: cleo on June 23, 2012, 16:10:24
Hello,

with Java 1.6.0_32 and higher, WaveData.create() (org.lwjgl.util.WaveData) returns null.

Anybody else with the same problem?

The latest OpenAL files in LWJGL 2.8.4 don't fix the problem, unfortunately.

Example:


FileInputStream fis = null;
try {
 fis = new FileInputStream( "sounds/test.wav" );
} catch ( FileNotFoundException e ) {
 return;
}
WaveData waveFile = WaveData.create( fis );
// Here, since Java 1.6.0_32, waveFile == null, any data load impossible


With Java 1.6.0_31 and lower, all worked well.

"sounds/test.wav" is a relative path. The file is found. Could it be that WaveData.create(fis) still needs the path, even though the FileInputStream has it already? If so, could it be that WaveData.create(fis) misses the relative path now due to a Java security update?

I'll try to add the BufferedInputStream stuff found at http://lwjgl.org/forum/index.php?topic=3890.0


Regards



Title: Re: OpenAL problem with Java 1.6.0_32 and higher
Post by: cleo on June 25, 2012, 07:33:14
Anybody out there with Java 1.6.0_32 or higher who does not have the above problem?

It would be nice to know if it's just me or a general bigger problem.


Thanks.
Title: Re: OpenAL problem with Java 1.6.0_32 and higher
Post by: cleo on June 29, 2012, 02:27:46
OK ...

FileInputStream fis = null;
try {
  fis = new FileInputStream( "sounds/test.wav" );
} catch ( FileNotFoundException e ) {
  return;
}
WaveData waveFile = WaveData.create( fis );
// Here, since Java 1.6.0_32, waveFile == null, any data load impossible


Changing the last line to ...

WaveData waveFile = WaveData.create( new BufferedInputStream( fis ) );

... fixed the problem.