Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 24. Multimedia: Applets and Appl... > Loading and Playing Audio Clips

24.5. Loading and Playing Audio Clips

Java programs can manipulate and play audio clips. Users can capture their own audio clips, and many clips are available in software products and over the Internet. Your system needs to be equipped with audio hardware (speakers and a sound card) to be able to play the audio clips.

Java provides several mechanisms for playing sounds in an applet. The two simplest are the Applet’s play method and the play method of the AudioClip interface. Additional audio capabilities are available in the Java Media Framework and Java Sound APIs. If you’d like to play a sound once in a program, the Applet method play loads the sound and plays it once, then the sound can be garbage collected. The Applet method play has two versions:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial