Why Would You Stream a Sound?

Its very rarely I do any animations and especially animations that need to sync with a sound. The other day I had a small job that required this.

I set my framerate and then import sound onto the timeline and set it’s Sync property to ‘Stream’. Once the animation was complete and I tested the movie the sound quality was absolutely aweful. It just wasn’t useable at all. The problem here was that is was just a voice over. The rest of the voices overs have been added directly to a director file and they are crystal clear, so I couldn’t just have a major drop in quality on this small flash animation. I tried lots of different compression settings but none of them produced a sound that was usable (i presume if your sound is music, then the quality difference wouldn’t be so noticable).

Setting the sounds Sync property to ‘Event’ dramtically improved the quality. The proble he is that when tested in the flash player all was fine. Insert the file in a browser or into the Director app that was going to host it and the sound and the animation wasn’t in sync with each other.

I then went down various road of outputting video (which produced strange results I will post about in a seperate post), pulling the video into AE and adding the sound, then rendering out this as a QT movie, and then finally importing it into Flash, as the Director app could use mpg1 video files apparently??? This was too bad but was an arse about way to try and get it working.

Then a bright idea came to me. Remove the sound from the timeline and create a sound object and attach the sound and play it with script. Then onEnterFrame check the position of the sound and force my timeline to the correct frame. This means they keep in sync and I have a decent quality sound. This works a treat and although the animation can get a little jerky now and then its definately the best option. Why anyone would use streaming I don’t know as this is a much better road to go down to sync sound and animation.[as]mySound = new Sound( this );
mySound.attachSound( “vo” );
mySound.start( 0 );

onEnterFrame = function()
frame = Math.round( ( 31 / 1000 ) * mySound.position );
gotoAndStop( frame );


I’d like to see and option next to the Sync property for sound that says something like ‘keep in sync’ so you can choose an ‘Event’ sound and it takes care of this stuff behind the scenes.

7 Responses to “Why Would You Stream a Sound?”

  1. Tommy says:

    Changing the bit rate under the Audio stream settings in the publish settings panel to a higher bit rate will usually do the trick to improve stream sound quality.

    The advantage to using stream is that it drops frames on the timeline to keep the animation in sync with the audio, without having to script it.

    Your method did the exact same thing though, nice work-around. :)

  2. Tink says:

    Believe me I tried all the settings and the sound quality remained unusable compared to the original and the other sound in the main Director app.

    I understand the advantage of streaming, but why does it have to drop the sound quality so much when dropping frames of animation. Surely this setting can be built to work the same way as my work-around internally therefore not compromising the sound.

  3. Tommy says:

    I’ve usually gotten good sound quality by just adjusting the bitrate, but I’ve never had a situation where the quality was going to be compared to the sound in a director app, or even the original source, so I guess it’s always just been “good enough.”

    Glad to know of this work-around if I ever find myself in a similar situation.

  4. I used to stream a lot of anmiation sounds – and had similar problems. In my case, it was not just the bit rate i had to futz with, but also had to make sure to match the sample rates. CD audio is usually 44,100 but there’s a LOT of digital stuff out there at 48,000… flash doesn’t like when these dont match. May have nothing to do w/ your streaming problem..but good to know.

  5. tom says:

    In that case nice solution :) Thanks!

  6. Matt says:

    Any bit rate changes or sample rate changes are IGNORED if the sync is set to stream. YOU MUST CHANGE THEM UNDER PUBLISH. This is very confusing – I suspect Tink may have tried changing them w/ o/ changing the publish settings. This took me a while to figure out!

  7. Tink says:

    You are right Matt, I wasn’t aware of this.

    I’ll have another play when I get a chance. Thanks for pointing this out!

Leave a Reply