LWJGL
May 22, 2012, 05:02:57
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
LWJGL 2.8.3 released!
Home
Help
Search
Login
Register
LWJGL
>
Archive
>
Resolved Bugs/RFE
>
[FIXED] possible bug in WaveData.create()
Pages: [
1
]
« previous
next »
Print
Author
Topic: [FIXED] possible bug in WaveData.create() (Read 1203 times)
carneades
Newbie
Posts: 4
[FIXED] possible bug in WaveData.create()
«
on:
February 19, 2010, 14:15:25 »
WaveData.java around line 209 calculates the byte array length based on AudioInputStream.getFrameLength() and then tries to fill the array using AudioInputStream.read(). Unfortunately this doesn't take into account that the stream may not be in its initial position. Say for example you only want to play seconds 2 through EOM (instead of 0 to EOM). A typical method is to use AudioInputStream.skip(). If WaveData.create() is called at that point it will create a byte array with two seconds of silence at the end.
Two possible solutions:
(1) Document this behavior so people know not to skip prior to giving WaveData an AudioInputStream, or
(2) Calculate the byte array length based on AudioInputStream.available()
I think the current situation is a little counterintuitive so I prefer (2).
Thank you for good Java OpenAL bindings and keep up the good work!
Logged
Matzon
Administrator
Demigod
Posts: 2177
Re: possible bug in WaveData.create()
«
Reply #1 on:
February 19, 2010, 23:11:20 »
can't say that I've ever had that need
- but I will get solution 2 implemented in the upcomming 2.3 release
Logged
http://certusgames.com
(Free Online Multiplayer Java Games)
http://lwjgl.org
(OpenGL/OpenAL for Java)
Matzon
Administrator
Demigod
Posts: 2177
Re: possible bug in WaveData.create()
«
Reply #2 on:
February 20, 2010, 02:44:13 »
Quote from: Matzon on February 19, 2010, 23:11:20
can't say that I've ever had that need
- but I will get solution 2 implemented in the upcomming 2.3 release
fixed in trunk
Logged
http://certusgames.com
(Free Online Multiplayer Java Games)
http://lwjgl.org
(OpenGL/OpenAL for Java)
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Programming
-----------------------------
=> Lightweight Java Library Game Development
=> LWJGL Documentation
=> Bug Reports / RFE
=> OpenGL
=> OpenAL
=> General Java Game Development
-----------------------------
Archive
-----------------------------
=> Resolved Bugs/RFE
=> DirectX
=> DevIL
=> FMOD
Loading...