Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (781)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (857)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  reading wav files located in in a jar file  (Read 4461 times)
0 Members and 1 Guest are viewing this topic.
Offline zero

Junior Devvie

« Posted 2005-06-23 23:17:40 »

Hi all,

is there any way to load a .wav from a jar file or input stream using ALut ?
I am asking because the method alutUnloadWAV only accepts a string.
Or is there a trick to convert the resource url to a string, that can be used?
I tried the following, but it didn't work. Sad url = ClassLoader.getSystemResource("MySound.wav"); 

// works well in = url.openStream();;

// but I can't use the file location as an argument to an FileInpuStream -
the exception:thrown, is listed below

ALut.alutLoadWAVFile( url.getFile(), ..); file:/home/gestalt/code/projects/beergarden/dist/beergarden.jar!/FancyPants.wav (No such file or directory)
        at Method)
        at javax.sound.sampled.AudioSystem.getAudioInputStream(
        at net.monoid.beergarden.RendererAL.loadALData(
        at net.monoid.beergarden.RendererAL.<init>(
        at net.monoid.beergarden.Main.main(

Offline zero

Junior Devvie

« Reply #1 - Posted 2005-06-27 00:06:29 »

After I have looked at the source code, I noticed that the problem easily could be solved, because:

The method ALut.alutLoadWAVFile(String  filename, ..) forwards the 'filename' variable to theWAVLoader.loadFromFile(String  filename, ..) and this creates a File object, which is passed to AudioSystem.getAudioInputStream(..). Since this method is overloaded for an InputStream and a URL, the ALut and WAVLoader classes could be updates easily.

Please do so, because otherwise I can't use these utilities with java webstart.

Best regards
Offline gregof

Junior Devvie

in code we trust

« Reply #2 - Posted 2005-06-28 21:21:33 »

I second that!, I actually had the exact same problem and came to the same solution  Cheesy

// Gregof
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline BrackishWater

Senior Newbie

I love YaBB 1G - SP1!

« Reply #3 - Posted 2005-12-28 19:37:05 »

couldn't you just write your own loader and pass the bytes off to JOAL in some fashion?
Offline Ken Russell

JGO Coder

Java games rock!

« Reply #4 - Posted 2005-12-28 20:06:18 »

If you check out the gluegen-branch-1-0 sources of the JOAL tree this has already been implemented:
cvs co -r gluegen-branch-1-0 joal

However you'll still need to build this source tree yourself which is a little involved since it requires a built JOGL workspace alongside it. Next week we'll promote this work to the main trunk and set up nightly builds for JOAL to save you this trouble.

I still need to make such a branch for the joal-demos workspace. I'll try to do that today.
Offline Ken Russell

JGO Coder

Java games rock!

« Reply #5 - Posted 2005-12-28 20:25:48 »

OK, the gluegen-branch-1-0 branch is there for the joal-demos workspace so you can just add "joal-demos" to the end of the cvs co line above to see examples of the new APIs. If you want I could put up builds for a couple of platforms to hold you over until the nightly builds are up; let me know which platforms.
Pages: [1]
  ignore  |  Print  

hadezbladez (1176 views)
2018-11-16 13:46:03

hadezbladez (530 views)
2018-11-16 13:41:33

hadezbladez (1187 views)
2018-11-16 13:35:35

hadezbladez (273 views)
2018-11-16 13:32:03

EgonOlsen (2570 views)
2018-06-10 19:43:48

EgonOlsen (2789 views)
2018-06-10 19:43:44

EgonOlsen (1565 views)
2018-06-10 19:43:20

DesertCoockie (2269 views)
2018-05-13 18:23:11

nelsongames (2122 views)
2018-04-24 18:15:36

nelsongames (2816 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!