I tried to run the above code(for playing audio clip) but i could not. I saved html and audio files but it is not working.
Please give me solution for this.
hey i tried the above code and it work fine and sound play successful thank you very much.but i want image .when i clicked on image the sound should be played .
eg. if i click on cat image it should play cat sound
and if i clicked on dog image it should play dog bow bow.
i'll be glade if you help me....
I want to play an audio your giving whole code is working but in method
audioClip = getAudioClip(getCodeBase(), "TestSnd.wav");
in getCodeBase() i got error. it returns URL class object how to handle this and where i should pass my audio file path
For the actionPerformed(ActionEvent ae) { ... }
I needed to use the following code for it to compare String.
public void actionPerformed(ActionEvent ae) {
Button source = (Button)ae.getSource();
if (source.getLabel().equals("p")) { audioClip.play(); }
else if (source.getLabel().equals("s")) { audioClip.stop(); }
}
comment on codes for soundIshita divya May 27, 2011 at 8:36 PM
I tried to run the above code(for playing audio clip) but i could not. I saved html and audio files but it is not working. Please give me solution for this.
audiofiledaljeet July 9, 2011 at 11:32 PM
how can i play a full audio song its not playing where I am wrong
audio in appletjayesh July 1, 2011 at 10:43 PM
how to use url in method ?
programmsikandar kumar July 29, 2011 at 9:15 AM
audioClip = getAudioClip(getCodeBase(), "TestSnd.wav"); where written inaddress of audiofile
play sound on click on imageMOHSIN KHAN June 2, 2013 at 12:58 AM
hey i tried the above code and it work fine and sound play successful thank you very much.but i want image .when i clicked on image the sound should be played . eg. if i click on cat image it should play cat sound and if i clicked on dog image it should play dog bow bow. i'll be glade if you help me....
How to link java applicaton parogramkanhaiya December 11, 2011 at 10:10 AM
Plz help me that how to link one to anther java applicaton parogram . i have created two java but i am not link these program so help me plz plz
error in playing audioUFAQ January 14, 2012 at 11:44 AM
I want to play an audio your giving whole code is working but in method audioClip = getAudioClip(getCodeBase(), "TestSnd.wav"); in getCodeBase() i got error. it returns URL class object how to handle this and where i should pass my audio file path
Regarding AppletAjit Kumar Pradhan January 29, 2012 at 10:51 AM
Whenever a program is developed to play an audio in applet,first where to place the audio file in my computer?
sample program K.Ramesh kumar February 2, 2012 at 1:31 PM
Please, give me sample program for insert Audio(sound) on Frame in java
audio playatul April 5, 2012 at 3:58 PM
its not working sound notplayed..bro
play sound in appletpooja sharma July 29, 2012 at 5:12 PM
it is not working for mp3 sound...
feedbackvijay September 4, 2012 at 11:01 AM
thanks for this code
ReplyJames Morozek May 6, 2013 at 2:38 AM
For the actionPerformed(ActionEvent ae) { ... } I needed to use the following code for it to compare String. public void actionPerformed(ActionEvent ae) { Button source = (Button)ae.getSource(); if (source.getLabel().equals("p")) { audioClip.play(); } else if (source.getLabel().equals("s")) { audioClip.stop(); } }
play sound in appletpooja sharma July 29, 2012 at 5:10 PM
your code work for only .wav sound.... not for mp3 sound for this what is solution....
Post your Comment