how to play audio track in java applat

how to play audio track in java applat

Sir,i took help of coding in how to play audio track in java applet....nd i found perfect code ..but when i run same code on net beans then it shows error that could not found main class file...as u see there is no main claas in this coding then how would i run dis code...and the code is

import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class PlayAppletSound extends Applet implements ActionListener{
  Button play,stop;
  AudioClip audioClip;

  public void init(){
  play = new Button("  Play in Loop  ");
  add(play);
  play.addActionListener(this);
  stop = new Button("  Stop  ");
  add(stop);
  stop.addActionListener(this);
  audioClip = getAudioClip(getCodeBase(), "TestSnd.wav");
  }

    @Override
  public void actionPerformed(ActionEvent ae){
  Button source = (Button)ae.getSource();
  if (  "  Play in Loop  ".equals(source.getLabel())){
  audioClip.play();
  }
  else if("  Stop  ".equals(source.getLabel())){
  audioClip.stop();
  }
  }

}
View Answers

September 5, 2011 at 12:09 PM

Applets always run on browser.

To compile a program in NetBeans, select Build->Compile from the menu. Alternatively, you can hit the F9 keyboard shortcut. If the compilation is successful, a message "Finished program name" appears in the Output Window.

If you supply an HTML file for your applet, you can launch a browser window from NetBeans to view the applet. Locate the HTML file in the file system explorer and click on it with the right mouse button. Select View from the menu. Your browser is launched and displays the result on the browser.









Related Tutorials/Questions & Answers:
how to play audio track in java applat
how to play audio track in java applat  Sir,i took help of coding in how to play audio track in java applet....nd i found perfect code ..but when i... file...as u see there is no main claas in this coding then how would i run dis
Play Audio in Java Applet
Play Audio in Java Applet       Introduction Java has the feature of the playing the sound file. This program will show you how to play a audio clip in your java applet
Advertisements
Java how to stop audio
Java how to stop audio  hello i have this code in the main: try { AudioInputStream audio = AudioSystem.getAudioInputStream(new File...(audio); clip.start(); } catch
audio file to play automatically
audio file to play automatically  I want to get an audio file to play automatically when someone visits my site
how to stop audio (mp3)
how to stop audio (mp3)   if(e.getActionCommand(). equals("Stop")){ player.stop(); } i am making an audio player in which i... stopping it. how should i stop the song keeping in mind i have to play another song
how to add audio clip in swings with event handling
how to add audio clip in swings with event handling  hello dear, i wanna to play audio clip in java program in JFrame in swings by event handling ,it should be like when i click on a button , audio clip should play , plz tell me
How to Track Website Traffic?
that actually translates into your website revenue. Thus to track website traffic... or measure your website standing in the overall competition. To track website... and popular online mechanism to track website traffic. You can assume Google's
how to run audio files in net beans using j2me
how to run audio files in net beans using j2me  i am running the audioMidlet in net beans. Now where should i place the .wav files inorder to play them
Audio MIDlet Example
Audio MIDlet Example       This example illustrates how to play audio songs in your... a player for an audio song by using of javax.microedition.media API. As you
How to track how many hits my website gets?
How to track how many hits my website gets?  Hi, Tracking a website... the website traffic. Tell me How to track how many hits my website gets? Thanks... traffic. Check the tutorial How do I track how many hits my website gets. Thanks
How to Remove audio from video file with FFmpeg?
How to Remove audio from video file with FFmpeg?  I have a video... in video. How to remove audio from video file with FFmpeg? thanks   Hi, You can use the '-an' option to remove the audio from video. Check
HTML5 audio reference
HTML5 audio reference  Hi, Tell me the best url to learn HTML5 audio tags with examples. Thanks   Hi, Learn how to use HTML5 audio tags to play the audio on web page. The HTML5 audio tag is used to play the video
track array declaration
track array declaration  how to track an array declaration in a input program
track file size changes
track file size changes  How to track a change in file size
Maven dependency for com.netease.cloudmusic.iotsdk - music_audio_base version 0.4.1.20231201130928 is released. Learn to use music_audio_base version 0.4.1.20231201130928 in Maven based Java projects
and Gradle. How to use  com.netease.cloudmusic.iotsdk - music_audio_base...; com.netease.cloudmusic.iotsdk - music_audio_base version 0.4.1.20231201130928 in Java projects... - music_audio_base version 0.4.1.20231201130928 java library in your project
Maven dependency for com.netease.cloudmusic.iotsdk - music_audio_base version 0.4.0-rc7 is released. Learn to use music_audio_base version 0.4.0-rc7 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use ... - music_audio_base version 0.4.0-rc7 java library in your project. ADS... 0.4.0-rc7 of music_audio_base released The developers of  
Maven dependency for com.netease.cloudmusic.iotsdk - music_audio_base version 0.4.2.20231225160642 is released. Learn to use music_audio_base version 0.4.2.20231225160642 in Maven based Java projects
and Gradle. How to use  com.netease.cloudmusic.iotsdk - music_audio_base...; com.netease.cloudmusic.iotsdk - music_audio_base version 0.4.2.20231225160642 in Java projects... - music_audio_base version 0.4.2.20231225160642 java library in your project
Maven dependency for com.netease.cloudmusic.iotsdk - music_audio_base version 0.0.0.1-rc12 is released. Learn to use music_audio_base version 0.0.0.1-rc12 in Maven based Java projects
0.0.0.1-rc12 ) in their Java project if it is based on Maven and Gradle. How...; com.netease.cloudmusic.iotsdk - music_audio_base version 0.0.0.1-rc12 java library... 0.0.0.1-rc12 of music_audio_base released The developers of  
Maven dependency for com.netease.cloudmusic.iotsdk - music_audio_base version 0.4.0-rc42 is released. Learn to use music_audio_base version 0.4.0-rc42 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use ...; com.netease.cloudmusic.iotsdk - music_audio_base version 0.4.0-rc42 java library in your project... 0.4.0-rc42 of music_audio_base released The developers of  
Audio Processing
Audio Processing  Sir, I want implement an audio recognition system by using java.. Is it possible? and tell me the process... thank you
Maven dependency for be.yildiz-games - module-audio version 1.0.0 is released. Learn to use module-audio version 1.0.0 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 1.0.0 in Java projects. Follow the step by step tutorial...-audio version 1.0.0 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 1.0.2 is released. Learn to use module-audio version 1.0.2 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 1.0.2 in Java projects. Follow the step by step tutorial...-audio version 1.0.2 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 1.0.3 is released. Learn to use module-audio version 1.0.3 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 1.0.3 in Java projects. Follow the step by step tutorial...-audio version 1.0.3 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 1.0.4 is released. Learn to use module-audio version 1.0.4 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 1.0.4 in Java projects. Follow the step by step tutorial...-audio version 1.0.4 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 1.0.5 is released. Learn to use module-audio version 1.0.5 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 1.0.5 in Java projects. Follow the step by step tutorial...-audio version 1.0.5 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 1.0.6 is released. Learn to use module-audio version 1.0.6 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 1.0.6 in Java projects. Follow the step by step tutorial...-audio version 1.0.6 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 1.0.7 is released. Learn to use module-audio version 1.0.7 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 1.0.7 in Java projects. Follow the step by step tutorial...-audio version 1.0.7 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 1.0.8 is released. Learn to use module-audio version 1.0.8 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 1.0.8 in Java projects. Follow the step by step tutorial...-audio version 1.0.8 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 1.0.9 is released. Learn to use module-audio version 1.0.9 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 1.0.9 in Java projects. Follow the step by step tutorial...-audio version 1.0.9 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 2.0.1 is released. Learn to use module-audio version 2.0.1 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 2.0.1 in Java projects. Follow the step by step tutorial...-audio version 2.0.1 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 2.0.2 is released. Learn to use module-audio version 2.0.2 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 2.0.2 in Java projects. Follow the step by step tutorial...-audio version 2.0.2 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 2.0.3 is released. Learn to use module-audio version 2.0.3 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 2.0.3 in Java projects. Follow the step by step tutorial...-audio version 2.0.3 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 2.0.4 is released. Learn to use module-audio version 2.0.4 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 2.0.4 in Java projects. Follow the step by step tutorial...-audio version 2.0.4 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 2.0.5 is released. Learn to use module-audio version 2.0.5 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 2.0.5 in Java projects. Follow the step by step tutorial...-audio version 2.0.5 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 2.0.6 is released. Learn to use module-audio version 2.0.6 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 2.0.6 in Java projects. Follow the step by step tutorial...-audio version 2.0.6 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 2.0.7 is released. Learn to use module-audio version 2.0.7 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 2.0.7 in Java projects. Follow the step by step tutorial...-audio version 2.0.7 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 1.0.1 is released. Learn to use module-audio version 1.0.1 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 1.0.1 in Java projects. Follow the step by step tutorial...-audio version 1.0.1 java library in your project. ADS_TO_REPLACE_2 Now you can
Maven dependency for be.yildiz-games - module-audio version 2.0.0 is released. Learn to use module-audio version 2.0.0 in Maven based Java projects
) in their Java project if it is based on Maven and Gradle. How to use  be.yildiz-games... - module-audio version 2.0.0 in Java projects. Follow the step by step tutorial...-audio version 2.0.0 java library in your project. ADS_TO_REPLACE_2 Now you can
J2ME Audio Record
J2ME Audio Record       This example is used to record the audio sound  and play the recorded... of the audio, To play the audio sound we are using the following source code
ModuleNotFoundError: No module named 'track'
ModuleNotFoundError: No module named 'track'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'track' How to remove the ModuleNotFoundError: No module named 'track'
Maven dependency for be.yildiz-games - module-audio-openal version 1.0.6 is released. Learn to use module-audio-openal version 1.0.6 in Maven based Java projects
version 1.0.6 ) in their Java project if it is based on Maven and Gradle. How...? Steps to use  be.yildiz-games - module-audio-openal version 1.0.6 in Java...-audio-openal released The developers of   be.yildiz-games - module-audio
Maven dependency for be.yildiz-games - module-audio-openal version 2.0.0 is released. Learn to use module-audio-openal version 2.0.0 in Maven based Java projects
version 2.0.0 ) in their Java project if it is based on Maven and Gradle. How...? Steps to use  be.yildiz-games - module-audio-openal version 2.0.0 in Java...-audio-openal released The developers of   be.yildiz-games - module-audio
Maven dependency for be.yildiz-games - module-audio-openal version 2.0.1 is released. Learn to use module-audio-openal version 2.0.1 in Maven based Java projects
version 2.0.1 ) in their Java project if it is based on Maven and Gradle. How...? Steps to use  be.yildiz-games - module-audio-openal version 2.0.1 in Java...-audio-openal released The developers of   be.yildiz-games - module-audio
Maven dependency for be.yildiz-games - module-audio-openal version 2.0.3 is released. Learn to use module-audio-openal version 2.0.3 in Maven based Java projects
version 2.0.3 ) in their Java project if it is based on Maven and Gradle. How...? Steps to use  be.yildiz-games - module-audio-openal version 2.0.3 in Java...-audio-openal released The developers of   be.yildiz-games - module-audio
Maven dependency for be.yildiz-games - module-audio-openal version 2.0.4 is released. Learn to use module-audio-openal version 2.0.4 in Maven based Java projects
version 2.0.4 ) in their Java project if it is based on Maven and Gradle. How...? Steps to use  be.yildiz-games - module-audio-openal version 2.0.4 in Java...-audio-openal released The developers of   be.yildiz-games - module-audio
Maven dependency for be.yildiz-games - module-audio-openal version 2.0.5 is released. Learn to use module-audio-openal version 2.0.5 in Maven based Java projects
version 2.0.5 ) in their Java project if it is based on Maven and Gradle. How...? Steps to use  be.yildiz-games - module-audio-openal version 2.0.5 in Java...-audio-openal released The developers of   be.yildiz-games - module-audio
Maven dependency for be.yildiz-games - module-audio-openal version 2.0.7 is released. Learn to use module-audio-openal version 2.0.7 in Maven based Java projects
version 2.0.7 ) in their Java project if it is based on Maven and Gradle. How...? Steps to use  be.yildiz-games - module-audio-openal version 2.0.7 in Java...-audio-openal released The developers of   be.yildiz-games - module-audio
Maven dependency for be.yildiz-games - module-audio-openal version 2.0.9 is released. Learn to use module-audio-openal version 2.0.9 in Maven based Java projects
version 2.0.9 ) in their Java project if it is based on Maven and Gradle. How...? Steps to use  be.yildiz-games - module-audio-openal version 2.0.9 in Java...-audio-openal released The developers of   be.yildiz-games - module-audio
Maven dependency for be.yildiz-games - module-audio-openal version 2.0.10 is released. Learn to use module-audio-openal version 2.0.10 in Maven based Java projects
. How to use  be.yildiz-games - module-audio-openal version 2.0.10 in project? Steps to use  be.yildiz-games - module-audio-openal version 2.0.10 in Java...-audio-openal released The developers of   be.yildiz-games - module
Maven dependency for be.yildiz-games - module-audio-openal version 2.0.11 is released. Learn to use module-audio-openal version 2.0.11 in Maven based Java projects
. How to use  be.yildiz-games - module-audio-openal version 2.0.11 in project? Steps to use  be.yildiz-games - module-audio-openal version 2.0.11 in Java...-audio-openal released The developers of   be.yildiz-games - module

Ads