Loading Sound Clips For Swing Application

I have searched all the forums, din't find what i want.
I have many small sound files to be played in my application. Even on mouse Pressed, Drage etc etc....
Now I was looking for a better way of Loading the Sound files in memory as the application starts.....
If I use the Clip Interface of javax.sound and initilize them and open a stream, invoke the open() method, and store it in hashmap. So that when ever i need that file i will lookup for that clip and trigger the start() method which actually plays the sound. IS the approach the right approach, will not the Cip object keep the IO handle open, I have nearly 40 Clips to be loaded.
Can any one suggest me the better way of implementing this.
TIA
Zoha

Please be aware that this is a 4 day long weekend in some parts of the world and the day after a 3 day weekend in much of the rest, so patience please.
On your sound question, you have control of the AudioInputStreams and can close them as needed, you should check to ensure that there aren't a lot of unwanted threads hanging around. If the clips are short and encoded in PCM format you could use the Applet.AudioClip class, your code doesn't need to be an applet.

Similar Messages

  • Erroe gettin in loading the data for sample application

    Dear Expert iam getting the followiong error while loading the data for sample application in Essbase Administrator Console form SampleApp_data.txt
    Parallel dataload enabled: [1] block prepare threads, [1] block write threads.
    Unknown Member [E01_0] in Data Load, [1] Records Completed
    Unexpected Essbase error 1003014
    can you please help me in this regrard,
    Thanks and regards,
    Kishore

    Hi,
    The error message is saying you don't have a member named "E01_0" in your outline, you can check this by opening the outline in EAS and trying to find the member.
    Once you have checked that go into planning web, administration, dimensions, select entities and search for "E01_0", if it exists then you have not refresh from planning to essbase. You will need to go manage database and refresh.
    Cheers
    John

  • Best load test software for RTMP application

    Hi everyone,
    I'd like to run some load tests for my application (AIR 3.4, Flex 4.6). I'm using flex messaging protocol RTMP and I was wondering which software could easily (or not) simulate my Producer job and how.
    Any feedback would be greatly appreciated.
    Regards,
    Fabien

    Hi Fabien,
    Have you heard about NeoLoad from Neotys?
    It is a load testing tool for Web applications. It is very focused on all RIA’s included Flex and RTMP.
    I’m working for the company, and you could think that my opinion is biased here.
    I then invite you to have a try yourself and download the trial version at www.neotys.com.
    It includes all RTMP and Flex capabilities. You’ll see how NeoLoad makes easy the handling of that protocol.
    Our website gives explanation on RTMP load testing, that might be helpful too.
    The last but not the least, we’re Adobe partner. Our tool has been designed accordingly to all RTMP requirements. You can go ahead with confidence.
    Regards,
    Olivier Hanoun.

  • Guidelines for deciding directory structure for Swing Application

    Hi,
    We are developing a Swing Application for our organization. We want to organize the code and resources/icons/properties files in correct manner.
    We have guidelines for arranging the code for web application. Is there any such guidelines available for desktop application as well? What is the preferred location for keeping the icons and properties files?
    Regards,
    Manu

    Thanks Maran.
    I have already checked many installation guides before posting here. All of them mention about creating folders like /admin or /oradata on various mount points but none of the naming conventions really indicate whether it is a 8i database or a 10g database.
    This is required when you are having multiple Oracle installations under /opt and databases are running from different mount points.
    Regards,

  • Including images in JAR for Swing Application

    I am using a couple of images in a Swing application. When I create the JAR file I include all the images. The JAR executes fine but the images are missing. When I put the images in the same directory as the JAR file the images are properly displayed.
    The code I use to display the images is:
    JLabel label = new JLabel(new ImageIcon("pleaseWait.gif"));
    Can anyone let me know what I need to do to get the image from the JAR? Do I need to look at ResourseBundle's?
    Thanks for any help..

    Does anybody know what is the reason of my problem??
    I created a package called test in my eclipse env. and in that package I placed folder named graph in which there is a file Help.png.
    Here is all the code I run in eclipse and it runs properly. When I create a jar file (using eclipse wizard) to execute without eclipse it can not execute and shows nothing (process starts and I have to kill it by myself in OS). Maybe there is some mistake with making jar... I do not know
    So let someone try tu run my class or build jar file and try to execute and share his observations (solutions) ??
    package test;
    import java.awt.Toolkit;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.UIManager;
    public class TestWindow extends JFrame {
         private JButton jButton1 = new JButton(new JARImage().getImage("Help.png"));
         public TestWindow() {
              this.getContentPane().add(jButton1);
              this.validate();
              this.setVisible(true);
         private class JARImage {
              protected ImageIcon getImage(String imageName) {
                   ImageIcon image = new ImageIcon();
                   try {
                        image.setImage((Toolkit.getDefaultToolkit().getImage(getClass()
                                  .getResource("graph/" + imageName))));
                   } catch (Exception ex) {
                        System.out.println("Image Error: " + ex);
                        ex.printStackTrace();
                   return image;
         public static void main(String[] args) {
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              } catch (Exception e) {
                   e.printStackTrace();
              new TestWindow();
    }

  • New look for swing applications

    Hi,
    I pretend to give diferent look to my swing applications, look like napkin , edding or some others that you guys may know,
    but how can i do it? i had read something about it, for example napkin is not working with netbeans anymore,
    do you guys know some other look that works?
    Thanks []

    Note: This thread was originally posted in the [New To Java|http://forums.sun.com/forum.jspa?forumID=54] forum, but moved to this forum for closer topic alignment.

  • License for swing application

    Hello guys,
    I need your help about a question.
    In the next days I'll develop a java application (swing application) for a customer.
    What I need is to forbid possibility to copy this application on other pc, so I need some license system.
    How can I bind installation of application (that is running of jar) on a specific pc and forbid to use it on other pc?
    I need to do it without key device, but via software.
    What's best solution for this issue?
    I would appreciate any help,
    Thanks

    snic.snac wrote:
    How exactly is that going to keep a user from using multiple copies on a single subscription?It isn't. And my message is that it isn't worth worrying about this ...
    The business "requirement" you have is usually not "how do I prevent my customer from making multiple copies" or "how do I prevent people from copying my application illegaly". Your requirement is (or should be) "how do I make more money with this".
    History has tought us that focusing on making the software hard-to-copy is a bad idea because the cost of making a reasonably well-working copy-protection is very high and even those are easily broken (it need only be broken once, then everyone can get a copy).
    Now if you make buying the software actually provide some additional value (automated, timely updates; online support; access to a feature-request queue; ...) and keep the price reasonable, then "copying + using only half a product" becomes more "expensive" to the user than "buying and getting the full advantage".
    I have to agree, 'though, that in the case of custom-built software for a single client that's not really relevant. I'd agree that you should simply request that they pay enough money so that you don't have to worry about copy protection. Maybe offer them the source if they do, so that they actually get some value out of it (see the theme? providing value for the money helps you get the money).

  • Help needed in writing installers for swing application

    Hi ,
    I want to write an installer for one of our home grown profiler tool. I need to write the installer for different platforms such as windows,linux,solaris,HP-UX.
    Does anybody have any idea of how to go ahead in writing installations. Share if there is any good links such as tutorials as well is thr any opensource tool (similar to installsheild) to write installers . As well following is the tentative algorithm for my install sheild
    1. Create a home dir for the tool and put all the application files in tht.
    2. Installing a 3rd party jar and make a home for it.
    3. Option for user to select the features(i hv 2 features. user can either select both or select individual feature) to be installed.
    4. Select the appserver home if any. On selection i hv to update the classpath in the startup batch file for the application(This is the toughest step i beleive bcoz each appserver have different folder structures and different startup batch files).

    Tried obtaining the output using SQL and the result is as follows:
    SQL> WITH T AS
      2  (
      3  SELECT 1 COL1 FROM DUAL
      4  UNION
      5  SELECT 2 COL1 FROM DUAL
      6  UNION
      7  SELECT 3 COL1 FROM DUAL
      8  UNION
      9  SELECT 4 COL1 FROM DUAL
    10  UNION
    11  SELECT 5 COL1 FROM DUAL
    12  UNION
    13  SELECT 8 COL1 FROM DUAL
    14  UNION
    15  SELECT 9 COL1 FROM DUAL
    16  UNION
    17  SELECT 10 COL1 FROM DUAL
    18  UNION
    19  SELECT 13 COL1 FROM DUAL
    20  UNION
    21  SELECT 14 COL1 FROM DUAL
    22  UNION
    23  SELECT 15 COL1 FROM DUAL
    24  UNION
    25  SELECT 16 COL1 FROM DUAL
    26  UNION
    27  SELECT 23 COL1 FROM DUAL
    28  UNION
    29  SELECT 24 COL1 FROM DUAL
    30  )
    31  SELECT OUTPUT FROM
    32  (
    33  SELECT DECODE(COL3,NULL,COL1, COL2)  || '-' || LEAD(DECODE(COL3,NULL,COL3, COL1)) OVER (ORDER BY DECODE(COL3,NULL,COL1, COL2)) OUTPUT  FROM
    34  (
    35  SELECT COL1, LEAD(COL1) OVER (ORDER BY COL1) COL2, LAG(COL1) OVER (ORDER BY COL1) COL3 FROM T
    36  )
    37  WHERE
    38  (COL2 - COL1 > 1 OR COL2 IS NULL OR COL3 IS NULL)
    39  )
    40  WHERE OUTPUT != '-';
    OUTPUT                                                                         
    1-5                                                                            
    8-10                                                                           
    13-16                                                                          
    23-24

  • Loading sound clips in my swing application

    I have searched all the forums, din't find what i want.
    I have many small sound files to be played in my application. Even on mouse Pressed, Drage etc etc....
    Now I was looking for a better way of Loading the Sound files in memory as the application starts.....
    If I use the Clip Interface of javax.sound and initilize them and open a stream, invoke the open() method, and store it in hashmap. So that when ever i need that file i will lookup for that clip and trigger the start() method which actually plays the sound. IS the approach the right approach, will not the Cip object keep the IO handle open, I have nearly 40 Clips to be loaded.
    Can any one suggest me the better way of implementing this.
    TIA
    Zoha

    As far as I know,there is no facility for detecting mouse scrolling wheel in JDK 1.3.
    Check it in the later releases of JDK.

  • Slow loading sound clips

    Hi:
    I created a tutorial project for a customer. The project
    consist of about 34-40 pieces of voice over to which sprites are
    animated visualizing what the voice over explains. I converted the
    voice clips to .wav files because I added cue points for director
    to recognize. I ended up with clips as big as 12mb. The total size
    of my executable right now is 184mb. The project plays fine, except
    that it takes about 30 seconds to start, and every time a new
    section is about to start, it takes about 5-10 second for the audio
    to load. Once the audio is loaded, it plays fine, until the next
    clip is reached, and it freezes again until it loads.
    Is there a way to load the whole project at once? Is there a
    better way to handle these type of projects? Am I stuck with what I
    have?
    Thank you for your help.

    In the help file there are instructions to make a "fast start
    projector". It is underthe heading "Creating Projectors".
    That is the
    fastest you can get it to load. there are a few other tricks,
    like
    making a bitmap (or pict on Mac) for a splash screen. Name it
    the same
    as the projector...
    i.e. if you have projector.exe then your splash screen will
    be named
    projector.bmp. It will popup almost immediately, so it at
    least looks
    like something is happening though it won't actually speed
    anything up.

  • ExpressCard/34 sound cards for dj applications ?

    hello,
    I was wondering if anyone knew about possible ExpressCard/34 soundcards available for ExpressCard/34 equipped machines ?
    nicolas

    Yeah, that would be good to know. What the sound like just out of the digital out?

  • Is there any Open source Reporting Toll for using in swing application ?

    Is there any reporting system like crystal report or any thing for report generation. Using JTable class it is so time taking job. I have downloaded Eclipse with crystal report embedded, and have created a report but can not integrate the report with JFrame with any menu item action. All the code i got releted to JSP. and few code get that are using
    //Crystal Java Reporting Component (JRC) imports.
    import com.crystaldecisions.reports.sdk.*;
    import com.crystaldecisions.sdk.occa.report.lib.*;
    //Java Imports.
    import javax.swing.*;
    public class JRCViewReport {
         private static final String REPORT_NAME = "JRCViewReport.rpt";
         public static void launchApplication() {
              try {
                   //Open report.
                   ReportClientDocument reportClientDoc = new ReportClientDocument();
                   reportClientDoc.open(REPORT_NAME, 0);
                   //Launch JFrame that contains the report viewer.
                   new ReportViewerFrame(reportClientDoc);          
              catch(ReportSDKException ex) {     
                   System.out.println(ex);
              catch(Exception ex) {
                   System.out.println(ex);               
         public static void main(String [] args) {
              //Event-dispatching thread to run Swing GUI.  This is good practice for Swing applications
              //to help ensure that events are dispatched in a predicatable order.
              //For more information on using this method, refer to the SUN site below for more details:
              //http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        //Hand-off to worker function to start application.
                        launchApplication();                    
    }Also there is one file ReportViewerFrame.java
    but the error is "*com.crystaldecisions.reports.sdk*" not found
    Please help ..........................................................

    I have already use Jasper Report. Thakns a lot for your suggestion. Now I think i have solved your problem...... View the code.. this code will not open the JasperViewer but from the background it will be printed and after calling the printing function you can save a data in the database ------------------------
    JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
            Connection con = Database.getConnection(); // your database connection
            jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, con);
            for(int i=0;;i++) { //print all pages
                try{
                    JRPrinterAWT.printPages(jasperPrint,i,i,false);
                }catch(Exception e) {
                    break;
            }

  • Load sound in java application without use of newAudioClip api.

    In personal java 1.2, (JDK1.1.8), the method newAudioClip is unavailable to load sound. What other api can one use to load sound into the java application in this case?

    there's nothing wrong with the old one, except that it's a api of the applet. If you try to run the applet thru' the java app. (without the browser or applet viewer), the getaudioclip api will fail.
    This is the limitation I am facing, 'cos I am developing in Personal Java1.2 env.

  • How can I unit test my Swing application?

    Hi All,
    In my application I came across a situation where I have to automate the unit testing of my application.
    Using my application user can able to draw polylines and rectangles on a BufferedImage added to a JFrame.
    Can any one please help/suggest me, how to automate the drawing process (this process consists of drawing the polylines with mouse and few action/mouse events)?
    your help will be highly helpful to me.
    Satya

    What exactly will that unit test prove? That you can mock the drawing of lines?
    Unit test are supposed to test certain parts of your application code - I'd concentrate on unit tests that are actually useful and for example in the future can help to catch regressions.
    If anywhere you can get help creating unit tests of this magnitude, I'd look in the unit testing support for Swing applications. Google for "java swing unit test" to see what you can come up with. Probably you'll need to create some plumbing yourself to make custom painting unit-testable; perhaps you could do something with painting to a BufferedImage in stead of to a Swing component for example.

  • Sound clip as greeting

    Any one know How can use recorded sound clip for example mp3 file as greeting for answering machine?

    Hello there,
    in order for a sound to play together with other animations you need to put the sound on top of the sequence AND group all animations together with the sound. You can then add delays to the animations if you want them to display in a sequence and not at the same time. If you need more than a single sequence (eg. two audio files speaking in the same slide) you can then add another separate group of audio+animations.
    L.

Maybe you are looking for