Hello Guest

OpenAL problem with Java 1.6.0_32 and higher

  • 2 Replies
  • 9910 Views
OpenAL problem with Java 1.6.0_32 and higher
« 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:

Code: [Select]
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

 

« Last Edit: June 23, 2012, 16:58:00 by cleo »

Re: OpenAL problem with Java 1.6.0_32 and higher
« Reply #1 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.

Re: OpenAL problem with Java 1.6.0_32 and higher
« Reply #2 on: June 29, 2012, 02:27:46 »
OK ...

Code: [Select]
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 ...

Code: [Select]
WaveData waveFile = WaveData.create( new BufferedInputStream( fis ) );
... fixed the problem.