Synchronizing sound and image for splash screen.

Hello all,
I have a peculiar request. ...
I have a sound file (about 137KB) and an animated gif (about 134KB).
I would like to use this as my splash window before my app starts up.
I know how to load these 2 to a screen but my problem is how do I synchronize the sound to go along with the image when it starts up? (Its a gunshot sound, whcih is looped with the animated image showing the bullet holes ;-)
I've been investigating using the Timer class but no success to date.
Currently, the sound file loads up, starts and then a few seconds later the image..
So.... How do I:
1. Load the sound first.
2. Load the image.
3. Start both of them synchronized.

This is actually pretty involved...
Are you using java.applet.AudioClip to play the sound? Are you loading the animated gif as a JLabel or something using ImageIcon?
If you are using AudioClip for the audio, I suggest that you cache the sound and image before playing the sound... otherwise you'll probably hear pops or the sound will pause. To cache the sound, do this:
AudioClip clip = Applet.newAudioClip("somefile");
Unfortunately, java really sucks at handling animated gifs. On slower computers, I've seen it take about 15-20 seconds to load an animated gif that's around 90k in size... totally unacceptable! If you have a gif that just plays a once (or a few times) and then stops, you'll have to flush the graphic to restart the image. This will reload the file and cause the long delay every time you need to replay the gif.
It seems like the best thing to do is to break up the animated gif into frames (either put each frame in its own file, or place each frame into one large image file and use clip rectangles to retrieve frames) and handle the animation yourself with your own thread. Alternatively, you can use the GifDecoder utility available at http://www.fmsware.com/stuff/gif.html, but be careful when using GifDecoder, it eats up a lot of memory for larger Gif files. When you handle the animation yourself, things should work properly. Again, make sure to cache the images by doing something like:
ImageIcon ii = new ImageIcon("somefile");
Once everything is preloaded, things should be pretty much synchronized if you play the sound and then show the image.
To have more control, you may have to use an object with synchronized methods... like if you want a sound to play on the 3rd and 10th frame of animation. Another option is to use Quicktime for Java.
If you need more info, let me know!

Similar Messages

  • Phonegap and squashed android splash screen

    Hi all,
    is there a way to get a splash screen to show correctly on most devides (phones, tablets...).
    I tried to use a 320x480 png file but I get horrible results: the splash image is brutally stretched while loaded on a tablet (landscape).
    Is there a way to set multiple images as splash screen and let the app pick the right one based on screen resolution/orientation?
    I also tried to use a 9-patch image but it seems phonegap ignore it.
    TIA
    tony

    Take a look at the config.xml documentation on the PhoneGap Build site: https://build.phonegap.com/docs/config-xml.
    PhoneGap supports ldpi, mdpi, and hdpi splash screens for Android with the following config options:
    <gap:splash src="splash/android/ldpi.png" gap:platform="android" gap:density="ldpi" />
    <gap:splash src="splash/android/mdpi.png" gap:platform="android" gap:density="mdpi" />
    <gap:splash src="splash/android/hdpi.png" gap:platform="android" gap:density="hdpi" />
    For details of the different screen resolutions supported by Android, see http://developer.android.com/guide/practices/screens_support.html.

  • Interval between sound and image!

    Hello all!
    I didn't see that question on the FAQs or in the most recent topics...
    On burnt DVDs via iDVD 5.0.1, I surprisingly notice a half-a-second interval between sound and image (the latter earlier), approaching the end of a long movie (45 minutes), should the movie be captured from the camera as a single clip, or should it be split into several clips in iMovie.
    As if the sound encoding would result in a longer sound tape as the video tape, the movie perfectly begins and the interval progressively installs...
    Any explanation or idea or tip to fix that?

    they may have been in a 12-bit format!
    12-bit seems to be the industry "standard" for camcorders. Both of mine came set to 12-bit. I learned about switching to 16-bit with my first one, because I read the manual. I wanted the best audio.

  • Labview Remote conection and acquire sound and image

    Good afternoon for everyone,
    What I want is the following:
    1. º How do I record values from a graph in Excel by pressing a button (eg recording).
    2. º How do I show my power picture and sound on my pc through the microphone and webcam laptop by pressing two buttons, for example sound "on" and picture "on" and do the "off" to both.
    3. º How do I power fizar my IP, since I already did what was on this page and I can not communicate with any other PC.
    http://redacacia.me/2010/10/15/internet-control-of-a-labview-vi-part-ii/
    Please find attached the program.
    Thank you and if I can help thanks a lot!
    Best Regards,
    FASP
    Attachments:
    imaqUSB.llb ‏174 KB
    Menu_Final_tabs.vi ‏5532 KB

    I'm sorry, but from your description I have no idea what you are trying to do. Ok, I see that LV is doing something, and that you want to acquire sound and images, and that the web is apparently involved. But,
    How is Excel involved?
    What is the web interface doing?
    Where are the buttons you talk about pressing located? 
    What are the sound and video sources?
    What version of LV are you using?
    What is the network you are using?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Imported MP3 sound and image CD Bird pics and sounds but each song is an album, so cluttering my album and artist lists. How can I keep together as one album please?

    I Imported a MP3 sound and image CD Bird - Birds of Sri Lanka - via itunes on my mac, then synched content to my Iphone as a Playlist to get all the songs/pics in alpha order. BUT each of the 329 birdsongs are listing/appearing as a separate album, so cluttering my album and artist lists :0(
    How can I get all the Birds of Sri Lanka songs/albums to come together as just one album please?
    Do I need to delete what i have, and download again in another way? :0(
    Can I move them all the songs somehow so they become ONE ALBUM :0)
    Thank you
    BW

    OOOOhhhhhh no worries, sorted it.
    In playlist Selected all songs, went into Get info and updated COMPILATION field from NO to YES.
    :0)

  • When I export my job on QuickTime, sound and image don't. respect.

    when I export my job on QuickTime, sound and image don't. respect.

    Don't what? They don't play in the Quicktime? The images don't show up? A little more information and we can might be able to help.

  • TS1382 my ipod got wet and allow time to dry, I turn now the musics and sound and everything but the screen is blank and nothing is visible. a solution please urgent.

    my ipod got wet and allow time to dry, I turn now the musics and sound and everything but the screen is blank and nothing is visible. a solution please urgent.

    See my reply to your other post

  • Image on the form for splash screen

    Hi there,
    How can I replace an existing image with a new one on my splash screen. Here's what I mean by this:
    I have a form which already has a splash screen logo. This logo will be replaced with a new one. The existing logo is attached as an image in the form of a .tiff file. There are no triggers on the form excepting a "when new form instance" which just says "SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE,'ABC').
    How can I ensure that the old logo is replaced with a new one.
    Here's what I did to replace, i.e my trouble shooting steps:
    a)opened the form and deleted the existing splash screen/.tif file
    b)went into the layout editor and clicked on "EDIT-> IMPORT" and mapped it to the .tif file that's persent in the local directory. As soon as I click OK, I get the following message :
    FORMS-VGS-507- Cannot open file or file not in specified format.
    Could any one help me out with this problem or can any one give me a better solution.
    Thanks in advance

    Are you talking about changing the splash screen when the Oracle Jinitiator loads? If so, this is controlled by the "base.htm" file in the /%FORMS_HOME%/forms/server directory (Windows and UNIX). If so, check out the [Oracle® Application Server Forms Services Deployment Guide|http://download.oracle.com/docs/cd/B25016_04/doc/dl/web/B14032_03/toc.htm], section [4.3.4.4 Applet or Object Parameters | http://download.oracle.com/docs/cd/B25016_04/doc/dl/web/B14032_03/configure003.htm#i1077074]. These links are for Forms 11g and 10g. If you are using an older, go to the [Oracle Forms Developer and Forms Services Documenation | http://www.oracle.com/technology/documentation/forms.html] to choose the right version and then select the Forms Services Deployment Guide. The "*splashScreen*" parameter in the base.htm file controls which image file is displayed as the splashscreen.
    If this is not the splash screen image you are talking about, please provide more information about your situation so we can better help you.
    Hope this helps.
    Craig...
    If a response is helpful or correct, please mark it accordingly

  • Display Image on Splash Screen

    have just found the world of Java, having used VB for a while.
    How do I get a mobile application to display an image on the splash screen, I have created the screen and added an image but cannot get the system to pick the file to display?

    class SplashCanvas extends Canvas
    Image splash;
    SplashCanvas()
      try{
       splash = Image.createImage ("/splashImage.png");
      } catch (IOException ioe)
    public void paint(Graphics g)
      g.setColor(255,255,255);
      g.fillRect(0,0,getWidth(),getHeight());
      g.setColor(0,0,255);
      g.drawImage(splash, getWidth()/2, g.getFont().getHeight(),Graphics.HCENTER|Graphics.TOP);
    } //End of SplashCanvas
    public class MyMidlet extends MIDlet
         protected void startApp(  ) throws MIDletStateChangeException
                   SplashCanvas sp = new SplashCanvas();
                   Display.getDisplay(this).setCurrent(sp);
    } //End of Midlet

  • CS6 apps: A suggestion for splash screens

    Hi. First of all, I couldn't find a more appropiate forum so please feel free to remove or relocate the post if it doesn't go here.
    I think that it would be nice to have the splash screens of the next generation of adobe applications pay homage to the great artists that serve as inspiration for us everyday.
    I've prepared 3 rough images just as an example. In every case, the letters that represent the program are the initials of the artist that it honours.
    Thanks for the space to post this.

    Nice idea, but personally I'd have to vote no.
    I can't stand splash screens.
    I already bought the program and I know what it is...so I definitely don't need to see an 'ad' everytime it launches.
    But that's just me.....
    Q. Barrie.

  • Adjusting the sound and brightness of the screen

    In SL i could hold down "shift" and "alt" and then adjust the soundvolume and brightness of the screen mucth more accurate. I have tryed the same thing in Lion, but nothing happends. I can adjust normaly, but I can't adjust it quite as accurate.
    Anyone know how to fix? Different keybindings in Lion?

    tarahmarie101 wrote:
    malcolmmc wrote:
    Just use maroonFloater[0] (the hue value).When I try to feed the hue value in, I get a type miscast error:There is no "miscast error". Please be more exact, when describing your problem. You need to be exact when programming and you need to be exact when getting help on programming. Paraphrasing error messages does not help.
    float [] maroonFloater [0]= maroon; Did you read the Arrays tutorial? Work your way through it. You will need it.
    If I understand properly, Arrays are in essence an arraylist of arraylists.Arrays are fixed-sized, ordered containers of data (either primitive data or object references).
    ArrayList is actually built on arrays.
    Regardless, I'm not that familiar with how to work with them.Until you familiarize yourself with them, you won't be able to solve this problem (and many others as well).
    As diligently as I've been googling, I cannot find a way to explicitly set the saturation or brightness for an RGB object, possibly because that RGB object is a Color, and if I get you, I can't set the S or B for an already instantiated Color.A Color object represents a Color defined by it's RGB values.
    The Color class provides methods to calculate the HSV values for a given set of RGB values and the other way around.
    The Color class provides a method to create a new Color object given the RGB values.
    Sounds like that's everything you need to solve your problem.

  • Shift between sound and image ?

    Hi there!
    I have a weird issue on my computer: there is a tiny shift between the sound and the image: the image goes faster than the sound, which is very annoying, especially when the movies are long. Sometimes it works perfectly and it seems to be because the computer is busy doing something else in the background. Otherwise when I'm just running quicktime, the shift appears... But I am not sure this is because of that actually. Any idea ? Thank you a lot !

    Any idea?
    Afraid I don't fully understand your question. If you are asking why this occurs, the reasons most frequently are:
    1) Camcorder audio recorded at 12 bits is converted/captured by harware/software that expects audio to be in a 16-bit format. In this case audio data is processed in groups of 16-bits where only 12 represent a discrete unit of coded sound.
    or
    2) "Muxed" source file using custom/non-standard bit rates and/or VBR audio is converted to a "frame-to-frame" sync format file. In this case, audio and video is "demuxed" to individual intermediate audio and video streams before final conversion to the target format. Once again, the intermediate audio usually expects a fixed/constant number of bits to represent a discrete unit of coded sound.
    Basically, what's happening is that the audio and video streams of information are no longer of the same length when laid out side by side (i.e., "frame-to-frame) and, thus, the audio and video are "out of sync." Specifics may vary. It all depends on the actual source formats, as well as, the manner in which the final streams are merged. Most frequently, the audio track ends up shorter than the video track. If they are merged by starting both tracks at the same time ("added"), then the audio gradually diverges from the video more and more throughout the movie and by the end of a long clip can be noticeable "out of sync." If the tracks are merged by "adding and scaling" one of the tracks, then the problem is somewhat more difficult to define. In this case, the beginning and end of the movie may be nticeable "out of sync" while the middle may almost seem to be "in sync."
    Now, if you are asking about solutions, then those depend on the source of the problem. Where the problem is merely in the camcorder setting, change it. If it is in the conversion/capture by hardware/software and user settings are available, then change them. If no such user settings are available, consider changing your work flow. (E.g., capture/convert using different hardware, software, or methodology such as digital-analog-digital double conversion where all else fails). Lastly, you could attemtp to "fix" the problem in "post-production." While is should be a last resort, many good editor applications do allow you to analyze the audio graphically and scale (compress/expand) tracks in order to "re-sync" them. While I have yet to try the utility myself, a dedicated application called "Movie Sync v1.0" is currently available for Mac machines. This utility allows the user to loop audio at a desired point in order to "locally" re-sync audio and video. (I can only assume a localized "scaling" is being performed.)
    Does that help?

  • Embedding fonts and images for printing (press quality PDF)

    I have a question about a document I have produced in InDesign that needs to go to the printers. They have told me to make sure it is a print ready document with all of the fonts and images embedded. When I convert an indd document for printing 'locally', I normally just use the Adobe PDF presets and select press quality. I thought ID works its magic and does everything required to make it print ready. Is there anything else I need to do regarding fonts and images to make the PDF ready for print?
    Thanks
    Mark

    Thank you.
    As to bleeds, the printers came back and said my pdf is okay but that yes, I need to set an extra bleed edge of minimum 3mm. Do I set this when converting to the print quality pdf or do I set this whilst working in the actual INDD document itself?
    Is the bleed then on every page regardless of the content?
    What are the steps for setting bleed and crop marks. Does that mean when I place an image for example on a page the image needs to hang slightly off the edges by 3mm or am I barking up the wrong tree?

  • How to display List and Image on Single Screen?

    Hi Friends,
    I wanna display Image and List on single screen.
    Its not possible using Form which will contain both. either I can list or form which contain image as far I know.
    I have seen one J2ME application which contain Image and below that there is list. Can anybody tell me how?
    Thanks,
    Rohan Chandane

    Hi,
    Are you able to put a list and image into a form.
    If so plz let me know the method to do tht.
    thanks.

  • Integrate webcenter capture and imaging for automating AP invoice process

    I need detailed document to understand how this integration is done and worked for automating AP invoice process.

    It turns out the process I had built in Process Builder was okay.
    I needed to setup a Process Injector to send the images in my IPM image
    application into the process and build a Work List.
    So, I get now get a worklist of packages on the E-Business side
    and can open images for the packages.
    Now, I need to work on the update process to update the related
    index values for the image, any help for updating image index values
    would be great.
    Thanks

Maybe you are looking for

  • G555. Need drivers for SM Bus and another Unknown device for Windows XP.

    I try to install Windows XP on my G555. I got all other drivers, but cannot find drivers for SM Bus and an Unknown device. And what's this device? The second problem is that after I installed all the drivers, the card reader disappeared. It was there

  • Quicktime stopped working in chrome

    Hi there Over the last few days Quicktime has dropped working in the Chrome Browser. It cannot find it for some reason and goes to a page where it thinks it can download it from but there is nothing to download. Stand alone quicktime works fine. Can

  • Bug in export to Excel with long SQL statement

    Good morning, we noticed a bug in Oracle SQL Developer 4.0.3 when we export data to Excel file with the "Query Worksheet Name" option enabled and the SQL code is very large: the script contains 10 IN() clauses with near 10'000 items, for a total of o

  • How to create a JMS persistent file store using WLST in WLS 9.0?

    Anybody have a good example of this? When I try to create a fileStore and set it on my jms server I am getting the following error: "TypeError: setPersistentStore(): 1st arg can't be coerced to weblogic.management.configuration.PersistentStoreMBean'

  • Memory paramter recommendations after Migration to 64bit

    Hi guys... we just upgraded our platform from Win 2000 + SQL 2000 (32bit) to Win 2008 R2 + SQL 2008 R2 (64bit). Server 1 : CI + DB  (32GB RAM) Server 2 : 1 App Instance (8GB RAM) Could you guys give me some recommendations for the memory settings on