7 Replies Latest reply on Dec 6, 2006 11:38 AM by kglad

    Sound for Animation

    PolarBabe
      I've built a Flash app that has three animated characters. My plan is to create and dynamically load a series of audio tracks that this animation app will use. The audio tracks will be a single SWF that packages both dialog and characters commands (mostly lipsync).

      I've put each character's audio and actions into a scene. Each scene calls the next - sequentially until the movie ends. It all works well except for two things.

      1) In selected scenes, the audio will finish, then restart before the next scene is called despite the fact that it's set to Stream. Whent the scene ends and chains the next scene, the audio ends abruptly.

      2) In other scenes, the actions are not in sync with the audio. Part of the action are lipsync commands. They are perfectly aligned in some scenes and not in others.

      If I pull these scenes out and run them by themselves, they play fine - no audio replay and perfect sync with the animation. I've built all scenes the same way. I've spent hours debugging and can't see why my frame specific alignment is not being interpreted correctly. I can't spot any difference in the scenes that play correctly and the rogue scenes.

      I've placed a sample FLA HERE

      Its a soundtrack so you'll see just a slice of video when one speaker talks. The others are animated in the main movie. The issue with this particular clips is that on my machine(s), the Charlie_PushTheButton scene, repeats the audio. I can't find any reason following the timeline, that its audio would play twice.

      All help appreciated.
      PolarBabe
        • 1. Re: Sound for Animation
          kglad Adobe Community Professional & MVP
          does your sound/animation syncing depend upon a constant swf frame rate? if so, then you'll have the problems you described unless you're using self-correcting code to maintain that frame rate.
          • 2. Sound for Animation
            PolarBabe Level 1
            Yes, I've broken the speech down to phonemes at 24fps. I've noticed though that Flash will skip frames in order to keep up with the sound. Sometimes the mouths make hasty changes but this seems to work fine as it generally keeps up. In the case described above, it simply plays the audio twice. I'm baffled.

            For my gee-whiz file, how would you self correct?
            • 3. Re: Sound for Animation
              kglad Adobe Community Professional & MVP
              first, ad a frame counter to see if your swf is maintaining 24 fps. if it is, frame rate's not the issue.

              to create a frame counter, create an empty movieclip and ad a textfield with instance name tf to the stage. attached to its first frame ad the code below.

              ad this movieclip to top layer in one of your scenes that gets out-of-sync and watch the frame rate to see if it maintains 24:

              • 4. Re: Sound for Animation
                PolarBabe Level 1
                Tried it. It's not the frame rate. There's something about this clip that is misbehaved. Did you try the FLA? Does it repeat audio for you? Thanks for your help.
                • 5. Re: Sound for Animation
                  kglad Adobe Community Professional & MVP
                  i downloaded your file and started to play it, but grew inpatient.

                  if each scene plays fine on its own you could use loadMovie() to load each scene in turn after creating a swf to correspond to each scene.
                  • 6. Re: Sound for Animation
                    PolarBabe Level 1
                    Why impatient? I'd really like to find out what's going on. The nature of what I'm doing requires that I get control of how and why things play when they play. For examle, why should it play differently to daisyChain loadMovie as opposed to chaining gotoAndPlay("scene", 1)?

                    I'd also then need a preloader to insure all movies were ready or the animation would pause. I'll keep playing at it.

                    Thanks for trying.
                    • 7. Re: Sound for Animation
                      kglad Adobe Community Professional & MVP
                      you're welcome.