1 / 6

Sounds

Sounds. Playing Sounds on the Web in Java. Sound. Applets can play sound clips Audio Files supported: .au .midi .rmf .wave .aiff. AudioClip Interface. Method Summary   public void loop()        Starts playing this audio clip in a loop.  

ira
Télécharger la présentation

Sounds

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sounds Playing Sounds on the Web in Java

  2. Sound • Applets can play sound clips • Audio Files supported: • .au • .midi • .rmf • .wave • .aiff

  3. AudioClip Interface • Method Summary   • public voidloop()       Starts playing this audio clip in a loop.   • public voidplay()          Starts playing this audio clip.   • public voidstop()          Stops playing this audio clip.

  4. Applet Methods for Audio • The applet class contains methods for getting an AudioClip object • AudioClipgetAudioClip(URLurl) • Returns the AudioClip object specified by the URL argument. • AudioClipgetAudioClip(URLurl, Stringname) • Returns the AudioClip object specified by the URL and name arguments.

  5. Using Runnable • Implement runnable in the class • Get URL of sound • Create Thread to play audioStart thread • play the sound, then • loop or • stop thread when done

  6. Another Way • Create a class extending thread. Constructor has audio URL as parameter • Its run class plays the audio • Create an object of the class • Start the object

More Related