package battleship;

import sun.audio.*;
import java.io.*;

public class Sound // Holds one audio file
{
    public void playIntro()
    {

        AudioStream bGM;


        try{
        bGM = new AudioStream(new FileInputStream("intro.wav"));

        AudioPlayer.player.start(bGM);

        } catch (IOException error){}

    }

}

I have that on one of my games and the music doesnt run, any help? If I place AudioPlayer.player.run(); after the first autoplayer I get the music to run, but the rest of my program won't continue after that method call.

did you already solve the question, or was that an error on your part?
anyway, doing this: catch (IOException error){} is always a good way not to find out what's going wrong in your application.
if it's not working yet, have you tried by using a thread? let the sound run in the background instead of it holding your application?

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.