How do I get this audio clip to stop processing

I am wondering how to get this AudioClip to end. Even though it stops after 4 iterations from the for loop in main my application continues running until I hit ctrl-c. I don't want to use System.exit( 0 ) because other applications will be running and I don't want to shut them down. For now just the basics, getting this process to quit on its own. I figured I would have to close the file with file.close( ), but no luck. Help would be appreciated thank you.
import java.io.*;
public class PlaySound {
     static String fnm = new String("attention.wav");
     static java.applet.AudioClip clip = null;
     java.io.File file = new java.io.File( fnm );
     public PlaySound( )
          try
               clip = java.applet.Applet.newAudioClip( file.toURL() );
          catch( Exception e )
               e.printStackTrace( );
     public void makeAlarmNoise( )
          clip.play();   //plays the audio clip
          //sleep for a while so it doesn't cluster the sounds
          try
               Thread.sleep( 1000 );
          catch( InterruptedException e ){ }                    
     } //end of method makeAlarmNoise
     public void stopNoise( )
          clip.stop( );
     public static void main( String Args[ ] )
          PlaySound ps = new PlaySound( );
          for( int i = 0; i < 5; i++ )
          ps.makeAlarmNoise( );
          ps.stopNoise( );
}     

No it doesn't -- thanks for the reply though.
The process keeps running even after it is done playing the wav file. I hear no sound but the process must still be running if I does not come to an end.
IT WON"T STOP. PLEASE MAKE IT STOP.
ex> when you run a "hello world" program the program runs and prints "hello world" then brings you back to the command line.
In my program, the program runs and then just sits there -- never bringing me back to the command line. I am wondering how to do that without System.exit( 0 ). Because when I use a GUI and use eventHandlers it still will not stop processing.
Try running this program with a short wave (.wav) file and you'll see what I mean.
Thank you.

Similar Messages

  • How do I get this tutorial "lady" to stop talking and naming everything I touch?  I just got this ipad for x-mas, and "she" wont stop talking out loud!

    I rec'd a new iPad2 for Christmas and cannot figure out how to get the tutorial "lady" to stop talking and naming everything I touch.  I'm having to double-click each button after she names it.  This CANNOT be how this think works!!  Please help!

    This might be what you mean...
    Voice Over Fix
    Settings > General > Accessibility > Voice Over > Off
    Or
    Press the Home Button 3 Times

  • How can I get one audio file to stop once another is triggered on the same page in EPUB?

    I have multiple audio files on one page and am able to trigger each separately with their own control panels. Unfortunately, these can all be played over one another. Is there a solution within InDesign to stop the first active audio file once another audio button is triggered on the same page?
    WIll this have to be done through Javascript?

    Use buttons. They can have have more than one action. Set a button to stop the first audio, and start the second.

  • Background noise removal takes about 3 seconds into each clip in timeline to kick in, so each clip has noise in the first few seconds.  How do you get this to remove noise from the very start of the clip?

    Background noise removal takes about 3 seconds into each clip in timeline to kick in, so each clip has noise in the first few seconds.  How do you get this to remove noise from the very start of the clip?

    insert a 5 second gap in the beginning of the timeline.

  • I did the 8.0.2 update and no longer have my speak to text microphone down by the smileys.  Don't want to use audio text.  How can I get this back?

    I did the 8.0.2 update and no longer have my speak to text microphone down by the smileys.  Don't want to use audio text.  How can I get this back?

    Hey there tjbliven,
    It sounds like you are not able to use the dictation feature of iOS 8, becuase the microphone icon is missing. It seems to me like Siri may be turned off, which would cause the icon to not be there:
    Siri settings - iPhone
    To set options for Siri, go to Settings > General > Siri. Options include:
    Turning Siri on or off
    That should get the dictation feature back for you.
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • Can't get my audio clip to work in Keynote except in edit mode. I've followed Help instructions to the letter. Any suggestions?

    Can't get my audio clip to work in Keynote except in edit mode. I've followed Help instructions to the letter. Any suggestions?

    Hi Gary - thanks so much for your help. I'd already done that, but finally stumbled across the answer for my situation. I'm new to iMac and this is the first time I used Keynote, so maybe this info will help someone else along the way - I still haven't found this in any of the Keynote documentation or forums I've read.
    My slides were all set up with at least one text box in which the text was animated. The sound was the last thing I added to each slide, exactly following the info in Keynote Help re: adding audio. The audio would work when I tested it in Inspector mode, and also if I switched to soundtrack instead. But not if sound was added to each individual slide. Hmmm. After I submitted the question above, I was running through the (auto) slide show one final time to check text, animation, etc. when I noticed that on just one single slide the sound effect came through, but at the very tail end of the slide. Hmm again. Why?
    Through trial & error, the answer was in the animation section - not very intuitive re: audio. The steps to correct the issue were: 1) click on the sound icon embedded in each slide, 2) click on the animation tab in Inspector. 3) There's a drop-down menu there that allows you to reposition the audio clip to the #1 spot (if it was added after other "animation"). This allows the sound to begin before the text animation begins on each slide. Before doing this, I guess the sound was in there but the slides were transitioning before it had a chance to play.
    Since this is the first time I've used Keynote and it's the most recent version, I'm not sure if this is a new feature to allow users to choose where within a slide to play a sound effect, but I'm guessing that might be why was unable to find any info on how to solve it. Hopefully this will help others who get stumped.
    Thanks again for jumping in to help! I really appreciate it.

  • How do I get home video clips from iMovie Mac to iMovie iPad?  Surely there is some degree of cross-compatibility?  I have a load of clips in iMovie on my MBP that I wanna download to my iPad2 so that I can edit movies on the move.  Any ideas?

    How do I get home video clips from iMovie Mac to iMovie iPad?  Surely there is some degree of cross-compatibility?  I have a load of clips in iMovie on my MBP that I wanna download to my iPad2 so that I can edit movies on the move.  Any ideas?  (The clips are in a .mov format, they have been imported / converted into this format in iMovie, original files were from a JVC camcorder in some other strange format.)

    I copied the iTunes file from the external drive and it's in both places.  I thought all I would need is the iTunes program (which I downloaded to new computer) and my iTunes library file.  There must be something else that's missing.  My iTunes library looks the same on the new computer as it does when I open it on the external drive.  If I click on an iTunes library song from my new computer, it will only play if I have the external drive plugged in.
    My back-up drive is a mess.  I have multiple copies of music, video, photo, and document files and I don't know how that happened. ={  Obviously, I don't know how to back up stuff properly and there are back-up files extending over a 6- to 8-year period.  I think all I did was just drag and drop the main folders from the back-up drive to the same main folders on the C: drive.  Also (and I'm kind of fuzzy on this) Windows used to automatically save music files in a folder within my document files (which makes no sense to me).  As my Jewish friends would say, "Oy Vey!" 

  • HT1222 my iphone 4S no longer plays music output to speaker after updating to version 6.1.3.  I am unable to reset the phone to an earlier version!  How do I get my audio output to speaker back? (music, audible, youtube, netflix))

    my iphone 4S no longer plays music output to speaker after updating to version 6.1.3.  I am unable to reset the phone to an earlier version!  How do I get my audio output to speaker back? (music, audible, youtube, netflix)

    So you have business contacts that were lost... do you not have these on a Database in some shape or form? Sounds like you need to invest in a RAID1 backup setup for your computer so you dont have this issue in the future.
    As for repairing your problem, sounds like you are going to need to start from scratch at this point or if the data is still on your phone look into a program that can take the information from the phone onto iTunes.

  • How can i get Beats audio back on my laptop?

    Hello,
    i have Windows 8 on my HP Pavilion dv6. I had Beats audio on it, but then my laptop was doing weird so i had to reset it to factory settings. After that, my laptop was back okay, but Beats audio was gone. My question is: how can i get Beats audio back on my laptop??
    This question was solved.
    View Solution.

    Hi,

  • How to send FCP edited audio clips for processing in Soundtrack?

    Hello
    How do I send just the edited audio clips from hour long files to be processed in Soundtrack from Final Cut?
    I need help as I'm trying to adjust some edited audio clips in Soundtrack Pro but when I send them from FCP to Soundtrack - it opens the whole original audio file and then any adjustments I apply in Soundtrack are being processed over the whole audio file not just the short edited audio clip that I want to adjust.
    Normally I don't mind as my scenes are usually short and Soundtrack analysis over the whole scenes audio is usually desirable, but this projects files have been transfered from tapes as hour long AVI files (all the tapes clips transfered into one hour long files) and every FCP edited audio clip I send is being treated as an hour long audio file in Soundtrack.
    I'm sure there's a simple answer for settings but I haven't been able to find it.  Any advice appreciated.
    Barra

    Thanks Javi, my sequence is an hour and half duration so what I'm trying to do is save processing time in Soundtrack by just processing adjustments on the few audio clips that need processing.
    I have set Soundtrack to open referenced audio only and with 5 sec in and out handles, but it still imports the whole original audio file into Soundtrack timeline upto the selected clip, I then double click in Soundtrack on the clip in brackets, and it then selects just the audio clip I want to adjust, then Soundtrack will just process on the edited clip but when I 'render to action' it seems to apply changes to whole original audio file - taking longer than I want.... frustrating
    Also the sound always sounds very different in FCP than Soundtrack even after 'rendering to action' and rendering in FCP... this is not the easy workflow I expect from such expensive software programs, I understood that they work together in a fully integrated way, what's the problem! This is wasting my precious time and preventing me from editing not helping me, this is a common problem and yet I can find no help in the user manual - I'm not impressed!

  • How do I get this effect?

    > This message is in MIME format. Since your mail reader
    does not understand
    this format, some or all of this message may not be legible.
    --B_3244557723_1857154
    Content-type: text/plain;
    charset="US-ASCII"
    Content-transfer-encoding: 7bit
    Hi!
    I have a series of QuickTime files that I am trying to
    present in a nice
    interface. I know how I can create this effect in Flash- but
    given the
    number of .movs I have, I am thinking of sticking to QT. The
    example I have
    in mind is
    http://www.apple.com/aperture/quicktours/
    I went through the source code and tried to replicate it by
    changing some of
    the values but it does not seem to work. I thought about
    using frames to
    ease complication but I find frames cumbersome. I am open to
    suggestions but
    would prefer to keep the video clips in QT versus converting
    to FLV.
    Thank you.
    Kelvin
    --B_3244557723_1857154
    Content-type: text/html;
    charset="US-ASCII"
    Content-transfer-encoding: quoted-printable
    <HTML>
    <HEAD>
    <TITLE>How do I get this effect?</TITLE>
    </HEAD>
    <BODY>
    <FONT FACE=3D"Arial"><SPAN
    STYLE=3D'font-size:12.0px'>Hi!<BR>
    <BR>
    I have a series of QuickTime files that I am trying to
    present in a nice in=
    terface. I know how I can create this effect in Flash- but
    given the number =
    of .movs I have, I am thinking of sticking to QT. The example
    I have in mind=
    is <a href=3D"
    /aperture/quicktours/</a><BR>
    <BR>
    I went through the source code and tried to replicate it by
    changing some o=
    f the values but it does not seem to work. I thought about
    using frames to e=
    ase complication but I find frames cumbersome. I am open to
    suggestions but =
    would prefer to keep the video clips in QT versus converting
    to FLV. <BR>
    <BR>
    Thank you.<BR>
    <BR>
    Kelvin</SPAN></FONT>
    </BODY>
    </HTML>
    --B_3244557723_1857154--

    Hi(Bonjour)!
    Welcome to the forum.
    It will be difficult to compose this effect in FCE without commercial plugins like Nattress's Big Box of Tricks (G Glow dissolve).
    But you can try this: create a colorized transparent document (yellow and red around the frame) in Photoshop. Save in PNG. Import into FCE.
    Put it on V2, over the edit point for your video clips in V1.
    Try to keyframe opacity values, animate the position with erratic displacements and add some twirling or distord effects (that can be keyframed too).
    With some patience, I'm sure that you can achieve a such effect.
    Michel Boissonneault

  • How do i get my audio book i purchased

    how do i get my audio book i purchased on my ipad from itunes

    Hve you downloaded this once already?
    Downloading past purchases from the App Store, iBookstore, and iTunes Store - http://support.apple.com/kb/ht2519 - enabled with iTunes 10.3 and newer; not available in all countries; only apps, books (not audiobooks), music, and t.v. shows (not movies).  Discontinued items not available. For items not included in the iCloud list, or locations or computer systems where iCloud is not (yet?) available, you only get one download per fee paid.  Apple notes it is your responsibility to back up your purchases.
    Select the store on the left side of iTunes.
    Click on Purchased on the right side under Quick Links.
    You can redownload your available previous purchases.

  • How do I get a movie clip to play fully in an iphoto slide show.

    How do I get a movie clip to play fully in an iphoto slideshow.  Right now it only plays for a few seconds, while the complete clip is 22 seconds.

    Bring up the Settings pane for the slideshow and click on the movie clip in the tray at the top.  Then in the Settings pane click on This Slide button and set the play time to the actual length of the movie clip. 
    OT

  • How do I get 2 video clips from Canon IXUS 75 into iMovie?

    How do I get 2 video clips from Canon IXUS 75 into iMovie?  I've tried several different things, but nothing seems to work...  I'll appreciate any help..  Thank you in advance.  (I do this all the time, but with a different camera...)  ;-/

    Thank you -- I was able to find an answer in the previous posts and I just figure it out!  ;-}

  • Anyone know how I can get an audio file imported into my iTunes' podcast directory, rather than the music directory?

    Anyone know how I can get an audio file imported into my iTunes' podcast directory, rather than the music directory?
    I downloaded a series of podcasts recently.  They were imported into my "music" directory instead, making it more difficult for me to recall where I left off with the last podcast I listened to before having to stop it for whatever reason.  Thanks in advance for any help.

    You can do it, though the result isn't ideal. Import your episode, then select it in the Music list and hit command-i to bring up the info panel:
    However each episode you do this with will turn up as a 'podcast' with no name - and it doesn't seem possible to give it one - containing the one episode:

Maybe you are looking for

  • Auto increment field in database issue

    Ok, I have read all about the issues with the auto increment field when trying to hook my form up to a ms access database. My problem is that the auto increment field is the one field I want in my form. Any suggestions how to create a new record with

  • What does compressor actually do?

    Sorry if this is stupid but I have owned a mac for about a year and I am always wondering what compressor is. It seems related to video editing but I'm not sure. Thanks, Macguy3000

  • Regarding FM  "RRX_GRID_CMD_PROCESS"

    Hello All, I am  using BW3.0. I am using this  FM "RRX_GRID_CMD_PROCESS"  to get the output  of the query  using Z  program.     CALL FUNCTION 'RRX_GRID_CMD_PROCESS'        EXPORTING             i_handle           = i_handle             i_cmdid      

  • How to fire event in VS C# when QuickTime sees a marker.

    I am using Visual Studio 2005 C# to run QT with ActiveX.  I have set markers in the video file that show up in the window at the bottom of a QT movie.  I want to be able to capture that marker with an event handler and tell a microcontroller to do so

  • Installing combined update for 10.4.11 from an iBook running 10.4.2

    My friend's iBook was having trouble running iTunes (stuttered play); I checked to see what version she had and found she was running 7.1 under 10.4.2. I launched Software Update (which was set to search for updates monthly, but hasn't been) and set