LWJGL Forum

Programming => OpenAL => Topic started by: Daroepfin on December 24, 2005, 06:23:08

Title: locating audio files
Post by: Daroepfin on December 24, 2005, 06:23:08
The WaveData class, when instanciated, looks for audio relative to the classpath, and that's kinda lame... I want to make it look 'absolutely', or relative to the working directory. I tried feeding it an absolute path and it didn't work.

Anybody have some advice?

Cheers
Jeff
Title: locating audio files
Post by: oNyx on December 24, 2005, 17:00:46
Relative to the classpath and relative to the working directory is the same (the former is a superset of the latter).

Well, use leading slashes (like "/sfx/blam.wav") for making it relative from the root of the classpath.
Title: locating audio files
Post by: Daroepfin on December 25, 2005, 03:28:25
Yeah, the workaround is easy, just not very elegant since netbeans has a weird place for putting my class files, which I feel I shouldn't need to worry about. I set it up to use a specific working directory, but LWJGL doesn't use that.

Oh, and so I don't the working directory is in the classpath necessarily...

It would be nice if WaveData took a location relative to the working directory, or if it could take an absolute address, or if it took a File as input.

~Jeff
Title: locating audio files
Post by: oNyx on December 25, 2005, 10:02:35
Its not a workaround. Its the proper way to do it.

Using files or absolute pathes would be an ugly hack, which would break outside of your building system. Dont do that.

Just add the resouce dir to the classpath (for the run bit) and use pathes with leading slashes. Thats all.