Problems deploying sounds with jar/game

I've almost finished my game, for as far as software can ever be finished. Now I've troubles creating a jar file that contains all of the game's resources. Within my IDE (Eclipse) the game finds & plays .wav files correctly using:
for(int i = 0; i< names.length;i++){     
     ais = null;
     cl = this.getClass().getClassLoader();               
     ais = AudioSystem.getAudioInputStream(cl.getResourceAsStream("sound/" + names));
     clips[i] = (Clip) AudioSystem.getLine(new DataLine.Info(Clip.class, ais.getFormat()));
     clips[i].open(ais);
But when I start the game using the jar file I get the following exception:
java.lang.NullPointerException
        at java.io.FilterInputStream.mark(FilterInputStream.java:179)
        at com.sun.media.sound.WaveFileReader.getAudioFileFormat(WaveFileReader.
java:94)
        at com.sun.media.sound.WaveFileReader.getAudioInputStream(WaveFileReader
.java:237)
        at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:
680)
        at field.TestFrame.initSoundContext(TestFrame.java:657)
        at field.TestFrame.init(TestFrame.java:157)
        at field.TestFrame.<init>(TestFrame.java:112)
        at field.TestFrame.main(TestFrame.java:117)
Exception in thread "main" java.lang.NullPointerException
        at field.TestFrame.initSoundContext(TestFrame.java:672)
        at field.TestFrame.init(TestFrame.java:157)
        at field.TestFrame.<init>(TestFrame.java:112)
        at field.TestFrame.main(TestFrame.java:117)Yes, I've made sure the .wav files are in the jar ;)
Does anyone know what the problem could be? Help ?-)
Greetings
Coen

Thank you for your reply, but I didn't get any further. I tried you code, but got another error.I use the same code (as described at the top) to load my images, but no problems there (?) I'll try to fix the problem myself, but suggestions would be very helpfull :)
Exception:
java.io.IOException: mark/reset not supported
at java.io.InputStream.reset(InputStream.java:329)
at java.io.FilterInputStream.reset(FilterInputStream.java:204)
at com.sun.media.sound.WaveFileReader.getAudioFileFormat(WaveFileReader.
java:128)
at com.sun.media.sound.WaveFileReader.getAudioInputStream(WaveFileReader
.java:237)
at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:
680)
at field.TestFrame.initSoundContext(TestFrame.java:658)
at field.TestFrame.init(TestFrame.java:157)
at field.TestFrame.<init>(TestFrame.java:112)
at field.TestFrame.main(TestFrame.java:117)
Exception in thread "main" java.lang.NullPointerException
at field.TestFrame.initSoundContext(TestFrame.java:673)
at field.TestFrame.init(TestFrame.java:157)
at field.TestFrame.<init>(TestFrame.java:112)
at field.TestFrame.main(TestFrame.java:117)
Thanks in advance for any help offered :)

Similar Messages

  • Problem deploying project with External Resource Integration with jars

    Hi,
    Please help ur how we can deploy a project in Enterprise server if that is integrated to some application which needs weblogic.jar. If this jar is made vesionable then it shows a size problem. If that jar is added to Install Drivers (In the configuration screen of Server) it does not accept it and does not show error while deployment. But, the activity which is using that application is failed while execution.
    Kindly provide me help over this.
    Regards,
    Sarang

    What do you mean with a "size" problem? I've added weblogic.jar to the project (or any jar of that size) and it works fine. As rightcord mentioned, you can just put it in the classpath, but if you don't want to, you can still use it in your process.
    You just have to deploy in another way, meaning you don't have to use the exported project but you can upload it the lcoation of where the server is running and publish from there - I believe this is option 1 in the Process Administrator.
    Good luck!

  • IPad , no sound with kids games - how do i fix

    jsut downloaded my first pbs kids games. there is no sound in any of the downloads.  can someone advise. 
    there is sound with music albums. 

    Have you got notifications muted ? Only notifications (including games) get muted, so the iPod and Videos apps, and headphones, still get sound.
    Depending on what you've got Settings > General > Use Side Switch To set to (mute or rotation lock), then you can mute notifications by the switch on the right hand side of the iPad, or via the taskbar : double-click the home button; slide from the left; and it's the icon far left; press home again to exit the taskbar. The function that isn't on the side switch is set via the taskbar instead : http://support.apple.com/kb/HT4085

  • Problem accessing sounds in jar file

    Hi,
    I have made a program and packed it to a jar file.
    Everything works fine in the IDE, so this is purely a matter of jar access.
    The jar has 6 folders.
    framework (which is one of my packages)
    META-INF
    sound (also my package)
    sounds (my wav files for the program)
    sprite (another package)
    sprites (my graphics for the program).
    I access the graphics in sprites, from a class in sprite and have no problem with it.
    try {               
                   URL url = this.getClass().getClassLoader().getResource(ref);               
                   if (url == null) {
                        fail("Kan ikke finde ref: "+ref);
                   sourceImage = ImageIO.read(url);
              } catch (IOException e) {
                   fail("fejl ved load: "+ref);
              }The problem is accessing the wav file in the sounds folder from a class in the sound folder.
    try{
                   AudioInputStream stream = AudioSystem.getAudioInputStream(new File("Sounds/1999.wav"));
                   AudioFormat format = stream.getFormat();
                   DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat(),
                             ((int)stream.getFrameLength()*format.getFrameSize()));
                   clip = (Clip) AudioSystem.getLine(info);
                   clip.open(stream);
              }I have tried to use the class loader like this (instead of AudioSystem.getAudioInputStream) :
    AudioInputStream stream = (AudioInputStream) this.getClass().getClassLoader().getResourceAsStream("sounds/1999.wav");          
    but it didnt help.
    Does anyone have any suggestione?
    Please, if all you can do, is paste a link to the java API, save your energy. I have already looked and it was no help, as im still only a student of java.
    I would like an actual suggestion, so i can see it work, then i can make work my way through the API from there.
    Edited by: Mondariz on May 7, 2008 8:26 AM

    Don't try to use a File object to access resources from the jar. You have a working process for accessing the sprites, just use the same process to access the sounds. Only not quite the same method, there's one method which returns a URL and a very similar method which returns an InputStream. I would post the link to the documentation but you asked for us to not do that. Anyway you seem to know where it is.

  • Java 7: Problems launching applets with jars on "file://" location

    Hi,
    We are experiencing a problem when updating our client's JRE from Java6 U 21 up to Java7 U 55.
    We have developed an Applet which is composed by several JAR files. Some of those JARs must be stored in local drive, and the JAR with the main Java class is stored on server.
    Let's supose we have a similar scenario like this:
    https://blahblahbah/bar.jar
    https://blahblahbah/test.html
    C:/foo.jar
    The code of test.html:
    <embed
      archive="file:///C:/foo.jar"
      cache_archive="bar.jar"
    />
    This code works fine on Java 6 and Applet is correctly loaded.
    However, with Java 7 a security exception is raised when trying to load JAR files from "file:///" location during Applet launch:
    java.lang.SecurityException: Permission denied: file:/C:/foo.jar
        at sun.plugin2.applet.Applet2Manager._loadJarFiles(Unknown Source)
    We have tried several tests using a java.policy file which grants all possible permisions:
    grant codeBase "file:/C:/foo.jar" {
        permission java.security.AllPermission;
    grant {
      permission java.security.AllPermission;
    We also tried to low Java's security level to "MEDIUM", with no success.
    We finally only managed to run the Applet if we explicity disable the "Next-Generation Plugin" with Internet Explorer 8. However, that's not a suitable solution, and still does not work with Mozilla family browsers.
    Eventhought with Mozilla browsers is still not working.
    Is there any restrictions in Java 7 that prevents to read jars from being loaded from local drive when launching Applets?
    Thanks in advance,

    Thank you baftos.
    I had read the whole message before posting mine. It's not the same problem. I'm able to run the sample signed applet always having the jar in the same location than the HTML page serving the applet via JNLP:
    <jar href="SignedAppletTest.jar" main="true"/>
    However, the security exception raises when trying to read that jar from local drive:
    <jar href="file://C:/SignedAppletTest.jar" main="true"/>
    ExitException[ 3]java.lang.SecurityException: Permission denied: file://C:/SignedAppletTest.jar
        at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
    I have even tried to decompile JNLP2Manager class, without seeing anything useful on that loadJarFiles method
    The only way I managed to avoid the problem is unchecking the New Generation Plugin and running the Applet with IE. Not a suitable solution for me at all..

  • Problem capturing sound with picture on Premiere 6.0

    I've been using this system successfully for 10 years and I promise it's the last project with it, I'm going HD with CS4 next month. But...
    Using Premiere 6.0. MAC G4 Dual 1000 processors, lots of RAM, 4 hard drives. For some reason when I capture a clip from tape through my Sony DS11 deck, the picture comes in fine, but without sound.  I've checked all the audio settings, they're all right.  I tried changing all the settings one at a time, it doen't help. I tried using the camera to capture from instead of the deck, no help.  I tried a tape shot with a different camera, nope.  I tried previous tapes that I was able to capture picture and sound from, now no sound. Oddly, occasionally it will work, maybe one in 20 tries. I'm finishing an important project and only need to lay in the narration, which I record with the camera using a good mike, but of course I can't capture sound. I'm tempted to reload Premiere onto the computer, but I'm afraid it won't hook up with the hundreds of clips already captured. Any suggestions?

    FW Capture, whether from your deck, or from your camera, should be just a byte-for-byte data transfer, using the Capture settings that you have chosen. You have confirmed that the settings are 100% correct, and your problem is with both the deck and the camera. That leaves the FW cable, and the connection on your Mac. Now, with either, I would expect that both the video and audio would be messed up, and not just one stream. Still, those would be the next things that I would check.
    Since my normal go-to utility, G-SPOT is not ported for the Mac, I'd use MediaInfo, and run one of the Captured files through it, just to see if there is an Audio stream - just on the off-chance that it's a playback issue. Assume that you are doing the Capture to MOV, so playing in QT Player should be a test too.
    Other than that, I don't have any ideas to help.
    Good luck,
    Hunt

  • Problem deploying composite with Business Rules

    I´m trying to deploy a simple composite at my EM, but the following error occurs when i try:
    [06:10:29 PM] Error deploying archive sca_POProcessing_rev1.1.jar to partition "default" on server AdminServer [http://soabpm-vm.site:7001]
    [06:10:29 PM] HTTP error code returned [500]
    [06:10:29 PM] Error message from server:
    There was an error deploying the composite on AdminServer: Deployment Failed: Error occurred during deployment of component: FulfillmentRules to service engine: implementation.decision, for composite: POProcessing: Error while loading the rule catalog.
    The rule catalog cannot be loaded.
    Check the underlying exception and correct the error. If the error persists, contact Oracle Support Services.
    A rule catalog could not be found.
    The catalog FulfillmentRules in package fulfillmentrules could not be found.
    Make sure that the rule catalog fulfillmentrules.FulfillmentRules exists in the path oracle/rules/fulfillmentrules/FulfillmentRules.rules:oramds:///soa/shared/common/oracle/rules/:oramds:///soa/shared/mediator/oracle/rules/:oramds:///soa/shared/rules/oracle/rules/:oramds:///soa/shared/workflow/oracle/rules/:oramds:///soa/shared/casemgmt/oracle/rules/
    It seems that it´s trying to lookup my component at MDS, but i didn´t implement it that way, so, what's going on?
    Any help would be most appreciate.

    I see what you're saying, but here's why it works the way you're observing it.
    Once deployed, the 10g business rules are edited by a business user (the owner of the rule). Changes in Studio that a developer makes to a business rule don't override the changes that the business user made.
    To let the business owner edit the rule, add a Global Interactive activity and change its property setting to edit the business rule. Put this activity in the role for the business owner (the person you want to edit the rule).
    Dan

  • Problems deploying application with updated method signatures on WLS8.1

    Hi,
    I have an jar file under applications which I have deployed fine on WLS 8.1 in the past. I changed the method signature on one of the EJB classes in the jar. One of the parameters now takes a different Java class type. I have recompiled everyone and repackaged the jar but when I try to deploy the jar it gives me an error because the the local interface of the EJB does not have the old Java class parameter type.
    I have checked the jar, classes in the jar, and the ejb-jar.xml and weblogic-ejb-jar.xml in the jar and it is looks fine. I have cleaned out my server deployment directories and verified the classpath in case the older jar was in there and everything looks OK. It seems for some reason 8.1 is caching the old ejb-jar.xml or somehow is remembering the old method signature and will not process the updated jar. Has anyone seen anything like this?
    Thanks for any help or recommendations

    Can you show me the error you receive?
    Another simple test would be to deploy your application to a new, empty
    server.
    You can create a new domain as easy as this:
    mkdir testDomain;
    cd testDomain;
    java weblogic.Server
    Type in the username/password that you want and answer 'Yes' when it
    asks if you want to create a new domain.
    Try deploying your jar to this new domain, and let me know if it still
    fails.
    -- Rob
    Jeff Dooley wrote:
    Hi,
    I have an jar file under applications which I have deployed fine on WLS 8.1 in the past. I changed the method signature on one of the EJB classes in the jar. One of the parameters now takes a different Java class type. I have recompiled everyone and repackaged the jar but when I try to deploy the jar it gives me an error because the the local interface of the EJB does not have the old Java class parameter type.
    I have checked the jar, classes in the jar, and the ejb-jar.xml and weblogic-ejb-jar.xml in the jar and it is looks fine. I have cleaned out my server deployment directories and verified the classpath in case the older jar was in there and everything looks OK. It seems for some reason 8.1 is caching the old ejb-jar.xml or somehow is remembering the old method signature and will not process the updated jar. Has anyone seen anything like this?
    Thanks for any help or recommendations

  • Problem deploying petstore with derby

    Hi all,
    I am deploying petstore1.4 on SunApplicationServer and default database derby. The asant and asant deploy is all complete. How ever I get the exception when populate the database. After some time of investing the sample folder and the build file, the problem may be this: - in the derby sql script folder, 3 databases have to be create separately: petstoredb, opcdb, supplierdb. However in the admin console, all the three connection pools just connect to derbyDB and in the build file just one script is executed ?
    Can anyone encouter the same problem and please show me how to fix this and make it work ?
    Thanks,

    You might want to ask this on the OC4J forum:
    OC4J
    Also chapter 13 in this tutorial might help:
    http://www.oracle.com/technology/obe/JavaEE_tutorial_10131/index.htm

  • Problem Importing Sound With Video

    I'm trying to import a quicktime file into Flash 8 basic and
    I'm having a problem with the file's audio track. The video comes
    through fine but the audio won't import with it. I've tried
    bringing the file in as an embedded video and a movie clip,
    importing to stage, importing to the library, integrating the audio
    track, making it separate. Every time I check the audio box in the
    properties bar all it says is "none." I'd try that linked Quicktime
    video option but my Flash doesn't support it. I can only embed the
    video in SWF. Any ideas about what's going on and how I can fix it?

    Could be that the audio format or resolution/bitrate is
    unsupported. Probably the easiest solution is to just convert the
    QT file to AVI before importing it.

  • Optical out problem: no sound with DVDplayer?

    Hi,
    I've got a problem with the optical output of my MBP. When I play a DVD with the DVDplayer app or VLC my receiver doesn't detect the optical signal from the MBP. I think this is a software problem.
    I say this because all the hardware I use seems to work fine:
    1. My receiver/amp detects the optical signal from another DVD player device with no problems.
    2. The optical cable I use with the MBP is the same cable as a use with the DVD player device (with the mini jack adaptor of course).
    3. When I insert the optical cable into the combined output of the MBP and I launch DVDplayer app, you can see the red light comming out at the other end of the cable.
    4. I've set in Audio/Midi app the digital signal to all possible combinations (44,1 kHz, 48 khz with 16, 20 and 24 bits)
    5. Trashed prefs of systemaudio, DVDplayer and Audio/Midi app.
    But it still doesn't work. Anybody knows what I can try?
    Thanks.

    Will iTunes play through the amp?

  • Problem: No sound with windows 7 upgrade

    Dear HP Community,
    I own a "HP TouchSmart IQ771.uk " and I have upgraded it from Windows Vista to Windows 7.
    but now I have no sound. I believe its because It doesnt have the driver that supports Windows 7, but Im not sure.
    I would appreciate some help or suggestions.
    Thank you 

    Try downloading and installing the Vista driver from
    Microsoft Update Catalog (Make sure you download the correct version (32-bit, x86; 64-bit, amd64)
    http://catalog.update.microsoft.com/v7/site/Search.aspx?q=HDAUDIO%5CFUNC_01%26VEN_11D4%26DEV_198B%26...
    You will need to extract the cab file and use Device Manager to install the driver.

  • Premier pro cs5 probleme ; no sound with maverick

    the sound on imovie work but on premiere pro cs5 no ....
    im on mac pro new one .
    thanks to help me

    Read Bill Hunt on Audio Conforming http://forums.adobe.com/thread/726693
    -and Source Patching http://forums.adobe.com/thread/1442800?tstart=0
    AND JUST FOR MAC USERS - Some 10.9.3 links
    -Mac 10.9.3 workaround https://forums.adobe.com/thread/1489922
    -more Mac 10.9.3 https://forums.adobe.com/thread/1491469
    -Enable Mac Root User https://forums.adobe.com/thread/1156604
    -more Root User http://forums.adobe.com/thread/879931
    -and more root user http://forums.adobe.com/thread/940869?tstart=0

  • Satellite L870-16C -display problems with some games

    Hi,
    I've bought this laptop recently and it turned out that i have tearing problems with some games.
    But really not with all games, just some of them (ex: the witcher, borderlands, trine...).
    So i was wondering what the problem could be?
    So far, i've heard it could be a v-sync problem, but everything i've done regarding this didn't change a thing.
    Is it just a software issue or could it be a hardware problem with the graphic card?
    I'm considering sending back my laptop to Toshiba, so i wanted to know if this was the only solution (and if it was a solution indeed).
    For information, it's a L870-16C with a ati radeon HD 7670m graphic card (driver version: 12.10-130101a-151427E-ATI), operating on windows 8 64 bit.
    Does anyone have some clues?
    thanks
    Message was edited by: Bakappoi

    What game problems do you have exactly?
    Could you be more precise?
    You said that you have some problems but NOT with all games.
    Therefore I dont think that you have an hardware problem
    In most cases (any) games issues are related to graphic card drivers in my long gaming experience, all issues which I had in the past were related to compatibility problems between driver and game.

  • Cannot record ingame sound with glc (-git)

    I have a problem with recording ingame sound with some games with glc (well, glc-git). glc says, it can record sound from games, if they use alsa (or sdl and forcing sdl to use alsa). As long as I don't use pulseaudio, this shouldn't be a problem. But for some games, I can't get the sound recording to work. The 2 at the moment are:
    FTL
    Amnesia: The Dark Descent
    I usually get a message like this:
    [ 1.46s alsa_hook error ] 0xa8a8170: unsupported audio format 0x0e
    [ 1.46s alsa_hook error ] 0xa8a8170: can't extract hardware configuration: Operation not supported (95)
    I can record the game, but not the audio. If someone can help or test it, if it works for him, that might be nice. Or if someone knows a workaround or so. Or if someone can confirm, that there is no audio recording for those 2 games (but I actually don't wanna hear it... :-) ).
    Also there are plenty of games, I got the audio recording to work with. You can see it in my youtube-channel: http://www.youtube.com/user/ChemBroTronNo1

    doorknob60 wrote:Do you use 64 bit? I don't have a copy of Amnesia downloaded right now, but if Amnesia is a 32 bit binary game, and you use 64 bit, you need to make sure you have the proper 32 bit libraries. lib32-glc will probably be enough.
    That's not the issue, the problem is that some games are firing 32-bit float audio (0x0e type as indicated in the error) into ALSA through whatever means, and the standard GLC only supports 16, 24 and 32bit signed int audio. My fork above adds very rudimentary support for float.
    Last edited by Darkimmortal (2012-12-02 01:13:35)

Maybe you are looking for