Applet: newAudioClip(URL audioFileURL) : Applet : java.applet : Java by API examples (example source code) Organized by topic

Java by API
C++
Java by API Home »  java.applet   » [  Applet  ]   
 



Applet: newAudioClip(URL audioFileURL)

/*
 * Output:
 */

import java.applet.Applet;
import java.applet.AudioClip;
import java.net.URL;

public class MainClass {
  public static void main(String[] args) {
    try {
      URL url = new URL("file:youraudiofile.wav" );
      AudioClip ac = Applet.newAudioClip(url);
      ac.play();

      System.out.println("Press any key to exit.");
      System.in.read();
      ac.stop();
    catch (Exception e) {
      System.out.println(e);
    }
  }
}

           
       
Related examples in the same category
1.  Applet: getDocumentBase()
2.  Applet: getImage(URL url, String name)








Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.