Home Answers Viewqa Java-Beginners how to play audio track in java applat

 
 


khindri
how to play audio track in java applat
1 Answer(s)      a year and 8 months ago
Posted in : Java Beginners

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 Pages:
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
the sound file. This program will show you how to play a audio clip in your java applet... Play Audio in Java Applet      ... is used to play the sound while stop() method is used for stop the running audio
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 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 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
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
play videos - Java Beginners
play videos   How to play videos on line.how to embed the video player in the browser.If you can give some basic idea about this i would be thankful to you. Thanks
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
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
audio files in jdbc connectivity with ms-access - JDBC
audio files in jdbc connectivity with ms-access  i need to know how to retrieve audio files through jdbc connectivity with ms-access and how to play...://www.roseindia.net/java/example/java/applet/PlaySoundApplet.shtml Hope
playing an audio file
how to solve this problem and also tell me where i should pass my audio clip path   Please visit the following link: http://www.roseindia.net/java...playing an audio file  In playing an audio file we have to take one
Audio
an applet and from an application. Where to learn about Java audio A good way to learn about audio is to read the "Sound" section of the Java Tutorial (see Other... Java NotesAudio Java 1.2 supports AIFF, AU, WAV, MIDI (types 1 and 2
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
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 files,IDE - Design concepts & design patterns
Audio files,IDE  HI! Gurus.I am david.i am a new to Java.i need detailed explanation on how to Create Audio files using Java language.Also i need... how to create games using Java?Please send answers to to this Questions to my E
How to play radio station on iPhone
How to play radio station on iPhone  how to play radio station on iphone
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
Play Lyrics on media player
Play Lyrics on media player  how to play lyrics on media player(MIDlet) while song is playing in background..its bit urgent... Thanks
HTML audio tag
HTML audio tag  Hi, I have written a simple html page to play audio file, I m using audio tag as shown below: Your browser does not support the audio tag. when I open the page using Chrome, it works fine(plays audio
J2ME Audio Record
J2ME Audio Record       This example is used to record the audio sound  and play the recorded... we try to show recording and playing of the audio, To play the audio sound we
iPhone play, pause and stop playing music
iPhone play, pause and stop playing music This is the small iPhone SDK example that will show you how to play, pause and stop the music on button... that just drag and paste the music or audio file into the resources folder, which
converter code for audio file
converter code for audio file  how can i convert a audio file to a another file format like mp3
ffmpeg audio from video
ffmpeg audio from video  Hi, How to extract audio from a video file? Thanks
pause play NSTimer
pause play NSTimer  How to pause or play NSTimer?   NSTimer *myTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(myMethod:) userInfo:nil repeats:YES]; - (void
avaudioplayer next track
avaudioplayer next track  How to set next and previous track in AVAudioPlayer in iPhone?   soundIndex=4; data=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:[array objectAtIndex:soundIndex]] error
audio video conferencing
audio video conferencing  how to develop a chat application in peer to peer setup
Broadcasting audio.. - JSP-Servlet
Broadcasting audio..  i am doing a project on Internet radio. I embeded windows media player,but doesnt know how to broadcast...i need to stream the audio. can anyone give a solution for this. Its very urgent
how to play video in website using jsp
how to play video in website using jsp   please help me friend how to play a video in webiste by using jsp which playres are used and how to play video please give me code
Play SWF file using Java - Applet
Play SWF file using Java  Hi I have task to design a screen saver using java. Now, I want to play .SWF (Flash file)in my Applet. Is there any way to play SWF from java class. Any reply will be appreciated. Thanks
Use Session to Track User in JSP
Use Session to Track User in JSP       This is detailed java code to track user... have created session_track_jsp.jsp page which will help you to understand how
How to play only video file from any link
How to play only video file from any link  Hi Friends Please Help Me. My requirement is to play only videos from any webpages(ITS NOT A ABSOLUTE PATH)[IF I PASTE any VRL---,IT HAS TO BE PLAY IN ANY CONTROL] how it possible
Implementing JSP and embedding Windows Media Player(wmp)
component in your page so that you can play the audio and video files in your JSP page... This example will illustrate you how you can embed Windows Media Player in a JSP page... the number of times a media item will play. Volume: "0" shows no volume
java code to display in audio - Java Beginners
java code to display in audio  Is their any java code, When i enterd text in text field , and when i press submit button,the text i entered should come in voice  Hi friend, Code to help in solving the problem
Developer's Jukebox
Vorbis Decoder jFLAC: Java Free Lossless Audio Codec... stay anywhere on disk) and play them. The tag information is stored in an XML.../redo. Currently, you can only play tracks that have been imported
Zoom Image with the help of play and reverse mehod in flex
() for zoom the component in flex and how to use play() function in this tutorial... to apply Play() for zoom  component and how to use reverse() for zoom...Flex Zoom with the help of Action Script:- In this tutorial you can see how
Car Music Streaming via iPhone Bluetooth, iphone Bluetooth Audio Streaming
the iPhone to the Car audio using Bluetooth. If your car has a supported Bluetooth... the play button. Now no need for cumbersome pairing and tangled wires. Just
flex didn't know how to drag and drop video and audio in flip book - Framework
flex didn't know how to drag and drop video and audio in flip book  ... target to add the video audio and photo in this book i am able to add the photo in this book but i didn't able to add video and audio so pls help me for my project
Hi Every One , please give me some idia to opning audio File . please Help ..
Hi Every One , please give me some idia to opning audio File . please Help ..  hi Dear Friend , please give me a program to opening audio file that ech extention will except it ,play sound by Button (PLAY) , pause it by Pause
java - Java Beginners
java  how to play audio song in java?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/applet/PlaySoundApplet.shtml Thanks
No matter what i do, eclipse applet WON'T PLAY SOUND - Java Beginners
No matter what i do, eclipse applet WON'T PLAY SOUND  OK, so I tried the code in http://www.roseindia.net/java/example/java/applet/PlaySoundApplet.shtml online, and it worked, but after i transfer the code EXACTLY to my pc
uploading audio file iphone
uploading audio file iphone  uploading audio file iphone
Led Track Lighting
Led Track Lighting  Led Track Lighting **Deleted by admin **, we are a direct importer and vendor of small business equipment & home goods. Buy at wholesale prices : Aquarium Supplies, Bicycle Motor, Business &
play SOund - Java3D
play SOund  I creat a player in j2me game, i use tasktimer to set schedule for it, but when i do this, memory increase continuously, it's about 20 minutes, it's out of memory, please help me  Hi Friend, Please visit
Play framework dynamic form generation
Play framework dynamic form generation  I want to generate dynamic forms using play framework can any one give me some idea about dynamic form generation using play framework
Track user's session using 'session' object in JSP
Track user's session using 'session' object in JSP This section... trackuserSession.jsp page which will help you to understand how to work with session...;/tr> <!-- this counter variable will print how much time user
JFrame Button click to start play
JFrame Button click to start play  i made a game and and i add a button in new jframe and i want when i click it it start to play...can anyone help me
HTML5 audio loop, Use of loop attribute of audio tag in  HTML5.
HTML5 audio loop, Use of loop attribute of audio tag in  HTML5. Introduction:Loop attribute is used for reputation of audio or music. It repeats audio file again, until you do not click any controls. It supports only Boolean
NoughtsAndCrossesGame play button doesn't work
NoughtsAndCrossesGame play button doesn't work   /* * To change this template, choose Tools | Templates * and open the template in the editor...("Play"); playButton.addActionListener(playHandler

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.