AudioTrack sound = audio.createAudioTrack("ringout.wav", false);

is giving me the output "WARNING: Unable to locate: ringout.wav"

The sound file is in the same project folder that i am using..Anyone knows what i might be doing wrong in here? Thanks a lot.

Recommended Answers

All 3 Replies

What does the audio object's class's API doc say about that error message?
Is this a compile time or execution time error?

Your a little short on explaining what your doing.

I am trying to run some audio files in a game.

private void mySound() {
        AudioSystem audio = AudioSystem.getSystem();
        audio.getEar().trackOrientation(cam);
        audio.getEar().trackPosition(cam);
        System.out.println(getClass().getResource("/ringout.wav"));
        /** Create program sound */
        targetSound = audio.createAudioTrack("/ringout.wav", false);
        targetSound.setMaxAudibleDistance(1000);
        targetSound.setVolume(1.0f);
        laserSound = audio.createAudioTrack("/start.wav",false);
                            laserSound.setMaxAudibleDistance(1000);
        laserSound.setVolume(1.0f);
    }

and my exception line looks like this...i'm just wondering if I have a problem with the format while providing the file name. ( not that its relevant but incase u see it in the exception i am using JMonkey as a game engine..) thanks again
Exception in game loop
java.lang.NullPointerException
at hello3d.test.myJmonkeyTest.setupSound(myJmonkeyTest.java:167)

Exception in game loop
java.lang.NullPointerException
at hello3d.test.myJmonkeyTest.setupSound(myJmonkeyTest.java:167)

What is at line 167 in myJmonkeyTest.java?
One of the references in that statement is null? test or myJmonkeyTest

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.