Can someone give me some code to play a certain MP3 as soon as the page loads? And where would i put such code?
-Thanks
Printable View
Can someone give me some code to play a certain MP3 as soon as the page loads? And where would i put such code?
-Thanks
I suppose you want an applet ? Cause if it's just javasscript I think you in the wrong forums ;)
Im not too sure if java is able to handle mp3 formats but here are the formats that i know it can definetly handle. WAV,MIDI, AU,AIFF
Audio clips are handled by an interface called AudioClip which all audio clips implement. You can use these methods on the audio clip which are found in the interface once the clip is retrieved.
void loop()
void play()
void stop()
Im assuming that you are using these in an applet so you would want to use the getAudioClip() methods for retrieving sound files specified by a given URL
AudioClip getAudioClip(URL url)
AudioClip getAudioClip(URL url, String filename)
There are also to overloaded play methods that can retrieve an play the audio clip.
void play(URL url)
void play(URL url,String filename)
i am pretty sure that you need a codec to play the mp3, and Java is the worst thing to do this, as it plays the mp3 so slowly.
y dont u just convert the mp3 file to a wav file useing something like music match jukebox and play the file as a wav in da background in da body tag or ur page
Because a mp3 is about 4 megs and a wav about 40megsQuote:
Originally posted by Strawberrys
y dont u just convert the mp3 file to a wav file useing something like music match jukebox and play the file as a wav in da background in da body tag or ur page