Playing basic sound ( *.wav ) through a click of button ?

Hi Java experts:
Need to know the Java code to be added to a click button 1 to play sound ( *.wav ) and the code to stop the sound through and other click of button 2.
Using a normal applet
Thank you in advance
M C Benzerari

See...the scenario is something like this : I have a main application running into a JFrame instance. Now, from a menu item in this JFrame, I have opened the modal JDialog. And from this modal JDialog, I have created a JFrame. Now I am not able to focus and perform any operation on this JFrame unless I close the JDialog from which it was created.
Please suggest some workaround so that without closing the JDialog, I am able to fire some event from the JFrame which is being created from this modal JDialog.
Thanks,
Gauri

Similar Messages

  • Playing audio sound when slide is clicked

    I have a button on my first slide which links to the third slide, and I want to play a sound as soon as the third slide is opened. How do I do this?

    Drag the sound file to the third slide. Select the speaker icon for it, and in the Build Inspector, set its Build In to "Start Audio". Click the More Options button to show the Build Order drawer, and use the dropdown menu to set the build to start "Automatically after transition".

  • Sound on/off by click a button in flex4????

    hello everybody, i want to make a website by flex.in that have sound  effect. i want when i load page have sound and if i don't want to listen  i can click button.the sound will stop play and else. But i don't know  how to make on/off sound by a button click
    i done:
    in actionscript file                Sound_playExample1.as: i write code
    package myComponents {
        import flash.display.Graphics;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.MouseEvent;
        import flash.events.ProgressEvent;
        import flash.media.Sound;
        import flash.media.SoundChannel;
        import flash.net.URLRequest;
        public class Sound_playExample1 extends Sprite {
                    private var snd:Sound = new Sound();
            private var channel:SoundChannel = new SoundChannel();
            public function Sound_playExample1() {           
                var req:URLRequest = new URLRequest("myComponents/soundall.mp3");
                snd.load(req);              
                    channel = snd.play(0,6);   
    // ActionScript file
    in my Main.mxml:i write
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:MyComp="myComponents.*"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
        <fx:Script>
            <![CDATA[
                protected function button1_clickHandler(event:MouseEvent):void
                    // TODO Auto-generated method stub
            ]]>
        </fx:Script>
        <fx:Declarations>
             <MyComp:Sound_playExample1/>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <s:Button x="177" y="71" label="Button" click="button1_clickHandler(event)"/>
    </s:Application>
    can u help me please what i have to do. if you know you can
    Additional for this code.thanks

    // below code sinppet should go into on button click event handle method.
    if
    (pausePosition==0 ){ if(channel!=null){pausePosition = channel.position;
    channel.stop();
    sound.setStyle("icon",soundOffClass);  // mute
    }else{ 
    if(channel!=null){channel.stop();
    channel = snd.play(pausePosition);
    sound.setStyle("icon",soundOnClass); // un mute , this should be default as
    pausePosition=0;

  • Playing two sound waves across two different sound cards simutaneously?

    Hello all.
    With the help from old board posts and the example VIs packaged with Labview 2009 SP1, I was able to get part of the way.
    The goal is to simutaneously play two .wav files, to two different sound cards. So far:
    1) I can play one wav file to either sound card
    2) I can generate two sine waves of different tones, and push each out to the two cards seperately simutaneously.
    But when I replace those two tones from #2 with .wav files, the wave files play alternately. So wav_1 plays to sound_card_1, THEN wav_2 plays to sound_card_2, not simutaneously.
    Is it even possible to play 2 wav files simutaneously out to different cards?
    I've included a VI of the attempt in #2 above. Disclaimer: my labview skills are minimal and this vi was very experimental so it's probably terrible form.
    Solved!
    Go to Solution.
    Attachments:
    sample_code.vi ‏23 KB

    Tzoom84,
    Since there is no way to buffer your sound output on the sound card and use hardware triggering you will be limited to software start timing.  You could use semaphores as you said, or simply wire both of the Sound Output writes in parallel inside a single while loop.  Since windows is nondeterministic the best you will likely achieve is the two outputs starting within tens of milliseconds of one another.  The time between the two starting will be affected by all other processes running on your system and may take much longer.  
    Regards,
    Sam K
    Applications Engineer
    National Instruments
    www.ni.com/support

  • Click a button, wait mc A to finish playing and play mc B

    Hello. I am using Adobe Flash pro CS6 and AS3.
    Right now I am trying to make a button to play a new mc. There are 2 movie clips. mc A and mc B.
    What I want to do is my swf is playing mc A but if I click a button, it starts to play mc B, but I want to  finish playing mc A before starting mc B, I mean it plays mc A (500 frames  loop animation) and if I click a button on 250 frames of mc A, it waits mc A to play remaining 250 frames, and if mc A finishes, it starts mc B.
    So I can not use gotoAndPlay command. What command should I use to do it?

    You could set some boolean variable to be true when you want mcB to play and at the end of mcA have it check the value of that variable and stop mcA/play mcB if the variable is true.

  • Audigy 2 NX - intermittent interrupted sound while playing 997Hz sine wave f

    I just now bought Audigy 2 NX last week. When I play a 997Hz -3dB sine wave sound file, the sound coming out from SPDIF and analog output jacks are not continuos, it is interrupted intermittently. The sine wave audio file is provided by a famous audio instrument company Audio Precision. I must play the sine wave file to verify my Audigy 2 NX. Unfortunately, the sound is not continuos. The sine wave file can be played very smoothly a nd correctly on other notebook PCs. Is there any one who knows what happened to my Audigy 2 NX ?
    Why do I play the 997Hz sine wave file ? I am responsible for design notebook PC hardware. I must test my audio design to see if I can pass Windows Vista Logorequirements or not. My company bought the Audio Precision instrument for the test. In order to test Microphone Input characteristic with the instrument, I must buy Audigy 2 NX to play the recorded audio file. Audio Precision recommend me to buy Audigy 2 NX for the measurement. The analog output of Audio Precision is connected to the Mic-In of my notebook PC. The notebok PC will record the 997Hz sine wave sound from Audio Precision. After recording the sine wave sound, I play the recorded file on my notebook. The file will be sent to Audigy 2NX from USB port, and then the Audigy 2 NX will send the sound to Audio Precision through SPDIF. Audio Precision will analyze the sound coming in from the SPDIF port. So I can measure Mic-In quality.

    Nikopoika wrote:
    I have same kind of problem with my "Soundblaster Audigy 24-Bit", cos' I can't enable the "Advanced HD" effect in FEAR and Quake 4. I've heard that it can be fixed with a patch but I'm not able to install any of these patches I have downloaded from creative.com, everytime I try to install some of these patches it causes a fatal error which says "Make sure you have installed previous drivers correctly". I have tried everything but nothing seems to work.
    Hello fellow sufferer
    As I've found out so far the Advanced HD in F.E.A.R. is EAX Advanced HD 4.0 and our SoundBlasters are, whysoever, limited to EAX 3.0. I guess the patch you tried to install was the EAX 4.0 patch for the Audigy 2 series (of course my NX is not included,arghh...).
    When I read "EAX ADVANCED HD Game Effects deli'vers mind-blowing gaming realism." in the Audigy 2 NX description on the creative site I did not realize that this "mind-blowing gaming realism" is strictly limited...

  • What's the wave's number of iPhone 4S speakers? I need to know what's the number because my phone doesn't play any sounds, and I kind of knew what's the problem and sulotion!

    What's the wave's number of iPhone 4S speakers? I need to know what's the number because my phone doesn't play any sounds, and I kind of knew what's the problem and solution!
    What I mean by wave is like radio channels' waves! Ex. 104.1

    Your statement makes no sense.
    Have you tried basic troubleshooting from the User's Guide to rule out some setting in the device preventing the speaker from working?
    Is the mute switch on?
    Do other sounds work?
    Does it produce sound with headphones plugged in?

  • How can I play music on my macbook pro (OSX Lion) through a Pioneer receiver. I've connected them with a mini display port to HDMI cable with audio support bought at the Apple Store, but there's no sound coming through. thanks

    How can I play music on my macbook pro (OSX Lion) through a Pioneer receiver? I've connected them with a mini display port to HDMI cable with audio support bought at the Apple Store, but there's no sound coming through. There are 4 HDMI-in ports on the receiver - BD, DVD, DVR/BDR and audio. In my system preferences for sound, the receiver doesn't show up as an output option. Can anyone please advise. (ps, this is my first time posting a question, so I hope I can find your answers!) thanks, JP downunder

    For sound, try the audio output port and connecting to the RCA  audio input ports on your Pioneer receiver.  Use something like this:
    http://eshop.macsales.com/item/OWC/PODCONNECTOR/
    Ciao.

  • I have the djay app on my ipad and i want to record the set i'm playing on my iphone through garageband. i need to take the sound from the headphone jack of the ipad, as the 30pin connector will be used to connect to the DJLive accessory. Is this possibl?

    i have the djay app on my ipad and i want to record the set i'm playing on my iphone through garageband. i need to take the sound from the headphone jack of the ipad, as the 30pin connector will be used to connect to the DJLive accessory. Is this possibl?reco

    You may get a better response in this community:
    https://discussions.apple.com/community/app_store/garageband_for_ios

  • HT3209 If I purchase an iTunes movie and try to play it back through my computer/tv via and hdmi connection, will I get sound only through my computer?

    If I purchase an iTunes movie and try to play it back through my computer/tv via and hdmi connection, will I get sound only through my computer?

    Welcome to the Apple Community.
    Only through iTunes/Quicktime and only if the TV supports HDCP.

  • Any ideas why a film I have  converted to mp4 format, that plays with sound through my PC windows media file- only has a picture but no sound when transferred to my ipod touch via the Itunes?

    Any ideas why a film I have  converted to mp4 format, that plays with sound through my PC windows media file- only has a picture but no sound when transferred to my ipod touch via the Itunes?

    See:
    iTunes: May be unable to transfer videos to iPhone, iPad, or iPod
    iTunes: Frequently asked questions about viewing and syncing videos

  • I tunes on my iphone will not play songs. it runs through the library at break neck speed when i click on a song...help!!, i tunes on my iphone will not play songs. it runs through the library at break neck speed when i click on a song...help!!

    i tunes on my iphone will not play songs. it runs through the library at break neck speed when i click on a song...help!!, i tunes on my iphone will not play songs. it runs through the library at break neck speed when i click on a song...help!!

    Try force-closing the Music app: from the home screen, double-tap the home button, locate Music in the list at the bottom, tap and hold it until it wiggles, tap to close it, tap the home button again, then try to play your music again.

  • My iPod touch plays no sound to videos but when I type I can hear the keyboard clicks. What do I do?

    I have had my iPod for 8 days now. I had have no problem with the volume until today. Whenever I type, I can hear the sound of the keyboard clicks and whenever I lock my iPod I can
    hear the click just when ever I try to listen to any videos, it plays but with no sound Please help me!

    Try:
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings                 
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
      Apple Retail Store - Genius Bar                                              

  • My iPhone 4S has decide to stop playing any of my music. All my songs are there, but when I click to play, it just scrolls through a bunch of songs and then reverts back to the play list. Anyone have any suggestions as to how to correct this? Thanks.

    My iPhone 4S has decide to stop playing any of my music. All my songs are there, but when I click to play, it just scrolls through a bunch of songs and then reverts back to the play list. Anyone have any suggestions as to how to correct this? Thanks.

    I am having the same issue. And today, I noticed that when I was talking on the phone, the volume went down low. I had to reboot the phone, so that the volume was up again. Mostly, though, it's my music that I am having issues with.
    Same issue as listed above. iPhone 4S. IOS6.

  • Hi, my brand new iphone 4 will not play music through my music app but it will play videos through youtube and will play the sounds throught my games and will play text tones and facetime ect. what is wrong?

    hi, my brand new iphone 4 will not play music through my music app but it will play videos through youtube and will play the sounds throught my games and will play text tones and facetime ect. what is wrong?

    At least I'm not the only one with the issue. I was looking it up so see if others had the same problem and found a bunch of posts about it. I'm assuming it's not the phone then, it's the software. Should I bring it to the Apple Store? Replacing the phone seems stupid, because the phone isn't really the problem. It's the software! Maybe the iOS 5.0.2 will fix it???  I don't really want to wait though, it's a pain. If a lot of people have this issue it should get Apple's attention. They need to do something to fix it, ASAP!

Maybe you are looking for

  • Problems Calling Graphics by Forms on the Web

    Hi! I'm not able to call a graphic on the web using Forms6i (Version 6.0.8.8.0 (Production)) and Graphics (Version 6.0.5.33.0). I made a call to a graphic using the RUN_PRODUCT built-in. On a client-server connection the call has no problem. On the W

  • Error in Mapping: Huge Payload

    Hi, I have got following error in my mapping and the payload is very huge (real time data) When I try to copy this payload to IR test space it hangs. It seems there is a data error for company code but I can't figure out which Details company code ha

  • How can I get rid of the "hoax" Firefox window telling me to upgrade?

    Every time I open Firefox 3.6.13, I get a window which tells me I'm running an old version and should update. Googling this, I found out it's some kind of hoax. It's really irritating and I'd like to find a way of preventing it from opening. Any idea

  • OamAuthn cookies are not set with encrypted value in https login with FFbro

    we have developed a custom login page which is deployed on oam server itself . In custom login page we are passing 3 userinfo like username ,passowrd and request id as part of authentication parameter . We have developed our own javascript to pass al

  • Deleted account limit reached icloud iphone 3gs

    how to reset or deleted account in icloud because has limit reached icloud account. and make new one account in icloud. because my phone is second buying?