Stopping an audio clip

In my program I'm using play(getDocumentBase(),"sound.au") to play some background music, but its a long file and I want to stop it at some point. How do I stop it?

Comments


  • HAPPY NEW YEAR ANYWAY !
    You have to declare an ActionEvent Listner
    Suppose you have ;

    [code]
    AudioClip sound;

    // then

    public void actionPerformed (IActionEvent e){
    if(actionEvent.getScource()==Stop)// assume you created a button "Stop"
    sound.stop();
    //the thread will then stop it.
    [/code]

    bashiro
    : In my program I'm using play(getDocumentBase(),"sound.au") to play some background music, but its a long file and I want to stop it at some point. How do I stop it?
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion