How to import a sound to a java program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mfshake
    New Member
    • Nov 2007
    • 16

    How to import a sound to a java program

    i trying to import a song that i already saved to my program
    does anybody know how do that? I tried but i need help on starting the program and importing the song
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by mfshake
    i trying to import a song that i already saved to my program
    does anybody know how do that? I tried but i need help on starting the program and importing the song
    It may sound funny but have a look at the static method Applet.newAudio Clip(URL url)
    It's a static method so you don't need to have an applet ready for this, simply use
    the method and it'll load an AudioClip object for you which you can play etc.
    All file formats specified in the AudioFileFormat .Type class can be loaded.
    Read the API documentation for them.

    kind regards,

    Jos

    Comment

    Working...