A Flash Developer Resource Site

Page 2 of 4 FirstFirst 1234 LastLast
Results 21 to 40 of 72

Thread: Sound Synchronisation

  1. #21
    Flashkit historian Frets's Avatar
    Join Date
    Oct 2000
    Location
    flashkit
    Posts
    8,797

    80 project.

    Forgive me all for repeating myself for the millionth time.

    In answer to your question. As your not concerned with true sync. just having the file play I suggest reading The following about uploading a sound file separately and initiating a start from an swf to an embedded file. I use windows media player Jeaf has used real player. If you do a search on jeaf and streaming I'm sure you'll find his perspective on this.

    As for mine it can be found here.
    http://www.swishspot.nwisg.com/cgi-b...rum=9&topic=12

    And here was my first succesful implementation of it
    http://occsn.org/sound/stream/index2.html

  2. #22
    Senior Member
    Join Date
    Jul 2001
    Location
    Queensland Australia
    Posts
    283
    Swishtopia , l have just finished a slideshow that has a pacy feel and sound track , it was built on a athlon 1.4 but my test machine is a P11 400 , my soundtrack is encoded using Flix , this movie plays excellent on both machines and the sync is excellent (within reason ) , before useing flix this movie was unplayable , you are right that cpu speed is very relevent to how a movie plays , but when you use load movie and a streaming encoded soundtrack , flash will drop animation frames to stay in sync frame for frame with the soundtrack , this makes a huge differance to how the timing is , in fast going flash movies a few skips and bumps with the visuals is not really noticable ,but if the sound is out , which it will be if you try and just tell swish play sound and select a big soundtrack , your movie will seem terrible , after what l have been through the last few days trying to meet a deadline with a movie that played crap a few days ago ,flix saved my but bigtime , l will never do sound in swish any other way , anything more than a button sound and l will use flix and load movie for the audio , your post lends me think that you haven,t tried a streaming encoded audio track , because it does work and very well to .

    Regards Rod

  3. #23
    Senior Member
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    869
    RodB,
    If you've read the above posts you can see that Cadence and I have been trying to test this out ourselves.

    Would it be possible for you to do a quick tutorial on how you use Swish and Flix. Not necessarily something graphical but maybe in steps.

    Many of us would very much appreciate understanding this concept.

  4. #24
    Senior Member Cadence's Avatar
    Join Date
    Aug 2000
    Location
    Columbus, Ohio
    Posts
    3,428
    Lisa ...

    Here is a brief tutorial (of sorts) ... It is fairly simple to impliment; however, the synchronization is the hard part

    For starters, here are the programs I used :

    SWiSH (duh)
    SwiffPeg (for audio - swf conversion)
    CoolEdit2000 (for audio recording/editing)

    The first thing to do, is to record a blank Mp3 file (or WAV, but - if you record a wav file, you'll have to convert it to Mp3 in order to use it with SwiffPeg - again, make sure it is either 11025, 22050, or 44100 hz ) ...

    You can use the built-in Windows Sound Recorder (which I can't find on WindowsXP Pro - so, I used CoolEdit) ...

    Record about 2 seconds of silence, then save the file (convert to Mp3 if necessary) ... Then use SwiffPeg to convert it to a .SWF file ... Here are the settings I used :

    In SwiffPeg :
    • Load your blank Mp3 file
    • Select the option "Create a New SWF File"
    • Uncheck both boxes - "Insert a Stop in First and Last frames" (you don't want it to stop at all)
    • Set the dimensions (I chose something small, like 100x100) - Then, set the Framerate (I used 12fps - the default - as the help files say it works best that way)
    • Then, convert your file ... I'd suggest uploading it to your web host at this point.


    Then, in SWiSH :
    • In Scene 1, create a normal preloader scene (with If Frame Loaded, and Preload Content action, etc.)
    • In Scene 2, insert a new sprite (a blank sprite - and name it)
    • Open the timeline of that sprite, and in Frame 1 add a "LoadMovie" action ... ie., LoadMovie - http://www.yourdomain.com/files/streams/blank.swf - the title of your converted blank .SWF file) ... then add a "STOP" action at frame 2.
    • Check the Sprite box, next to "Level" - this will load it into the sprite at level -1, and not into a seperate level.
    • Make sure you "Place" that sprite at Frame 0 of the main movie ...
    • .... my streaming .swf file was about 35kb, so I wanted to make sure it was finished loading before I actually started the music in the timeline ... so, I added a "Please wait" for about 50 frames ...
    • When you want the music to start, in SWiSH, add a "Play Sound" action (in the main timeline) and import the audio file you want to sync the animation to
    • Go from there


    I'll use my example as an example (hrmnn ...)
    I wanted to sync certain text objects with words in the song ... So, I listened to the song and wrote down the time at which the words were sung ... For example, the words "Big Moe" were sung at 6.5 seconds ... So, I multiplied 6.5 x 12 (fps), and came up with a frame count (78 frames) ... My music had started playing at frame 100, so I added 78+100, and I placed my "Big Moe" text at frame 178 (I know, this is just basic math - but it was the only way I could think of doing it without going through a LOT of trial and error) ... As it turns out, I had to adjust the "Place" action plus or minus a couple of frames to get it exact ...

    As a side note, I always used the "Test in Browser" feature to preview the synchronization -- that way, it would always load that streaming audio .SWF file, and therefore "locking" the framerate. ... It seemed to work

    I am offering free Blank Streaming Audio files (in several framerates) on my website : http://www.purifiedproductions.com/t.../downloads.htm

    I hope this helps explains things somewhat -- if it doesn't, please feel free to e-mail me and I can try to help a bit more ... I'd be happy to

    cadence@purifiedproductions.com
    Peaces,
    Cadence
    [Edited by Cadence on 05-06-2002 at 10:54 AM]

  5. #25
    Senior Member
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    869
    Cadence,

    Correct me if I'm wrong but wouldn't steps be the the same regardless of what application you are using to create the streaming SWF (i.e., SwiffPeg, Flix, Swideo or other). The only difference being on how you create the streaming SWF from within the "other" application.

    So you could use whatever encoder you want and then follow the Swish steps?

    Even though SwiffPeg only uses MP3, your blank streaming SWF is only around 35k which in my opinion in minimal and if this idea works, you could use SwiffPeg at 1/3 the cost of Flix. (Yes I know Flix does alot more, but if you're only interested in streaming audo, this is a great alternative.)

    Unfortunately I can't try it now (working on an ecommerce site) but will try it this afternoon.

    Thanks very, very much for the steps, I really apprecaite it.

    Lisa

  6. #26
    Member
    Join Date
    Nov 2001
    Posts
    76
    your post lends me think that you haven,t tried a streaming encoded audio track
    Quite the contrary, I own a $320,000 professional recording studio and we have been in direct contact with Macromedia over this very same issue. They themselves told us that it is not possible to do. They said;

    …different CPU processors will process .swf files differently. They cannot sync.
    I have two questions for you. How long is your movie, and can we test it on our own machines?
    I have a 180 Mhz. Pentium Pro that would just love to play… er... I mean test… your file




  7. #27
    Senior Member
    Join Date
    Jul 2001
    Location
    Queensland Australia
    Posts
    283
    Hi guys

    Ok swishtopia , if you mean that a particular animation frame is in "exact" sync with a particular audio frame , on all cpu speeds all of the time , of course perfect sync is not possible with the flash player to these fine degrees ,
    I stated " within reason " meaning you can get it to a point where it is acceptable not perfect but ok for general across the board use , how can you expect a old machine to play anything on par with a fast machine , you carnt ,thats why we try and sit in the middle of the road
    with our projects .
    I dont think anybody in this thread has stated that you can get " perfect sync " perfect carnt be done in the flash player just as you stated .
    But you can get it within reason , lm not trying to do a Speilberg production ,just small presentations for small business ,and the people l deal with are just everyday
    Joe Bloggs that are not splitting hairs , if a project looks and sounds ok to them ,thats fine with me .

    Swishtopia this a case where the amature ( me ) meets the pro ( you ) and l think we are both right

    Regards Rod

    Hi Lisa
    What l have done is very simple and nothing special

    1) First l have mixed my soundtrack useing " acousticas mp3 mixer"
    l like useing this mixer as l can have the soundtrack right in front of me and see where movie is in relation to the sound ,and can adjust it easy .
    The other reason l like this mixer is it is cheap and so easy to use ,and gives excellent results .

    2) Once l have the soundtrack l want , l then incode it in Flix , l select the same fps as my movie , l have encoded it at its highest quality
    levels 44,000hz and a bitrate of 256 , the funny thing here is l tried the lower quality settings and it ran virtually no different ,so l went
    for the best quality sound . Remember lm doing a cd-rom here , l have no idea about this for the web .

    3) Now heres the easy part , just select the point you want your sound to start playing in swish and load movie (soundtrack ) into level one , you can also
    insert a sprite and on the first frame of the sprite load movie (soundtrack) and place the sprite on the frame you want or tell target ,sprite play
    just make sure you unloop the sprite .

    l have on this project 7 movies that daisey chain ,with the sound loaded into level one and l have a stop at the last frame of the main movie so it dont loop
    and thats it .
    The more time you put into the sound mixing the closer your sync will be , its not perfect but lm very happy with how its turned out , one thing for sure its
    way better than it was before l used Flix , and even short sounds of only 200 frames l use flix and load movie , the only sounds l dont use flix on is like
    10 or 20 frame button sounds .

    Hope this helps you some
    Regards Rod

  8. #28
    Senior Member
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    869
    RodB,
    Thanks for replying with your method, I really appreciate it and I'm sure many others will as well.


  9. #29
    Senior Member
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    869

    Tools to make Streaming SWFs

    Now that we know we can get audio to sync with our Swish movies (within reason), let's take a look at the different tools available to help us do this.

    So far this is the list that I have.

    Tools that have been tested:

    • Wildform's Flix - Price: $99 - http://www.wildform.com
    Converts video, audio and image (many formats) to SWF

    • Swideo - Price: $39 - http://www.swideo.com
    Converts video, audio and image (many formats) to SWF

    • SwiffPeg - Price: $25 - http://www.swifftoolscom/stools
    Converts MP3 to SWF

    Other viable solutions, not yet tested:

    • Swift-MP3 - Price: $Free - http://www.swift-tools.com
    Converts MP3 files into Flash files

    • Soundnails - Price: $10-65 - http://www.soundnails.com
    Converts MP3 to SWF

    • Vid2SWF - Price: $25 - http://www.javakitty.com

    • Livetronix SWF Convert - Price: $19.99 - http://www.livetronix.com/products/swfconvert/index.php

    • CrashSoftware V2F (Video to Flash - Price: $24.95 - http://www.crashsoftware.com

    • Turbine Video Encoder - Price: $145 - http://www.blue-pac.com/products/turbinevideo/

    If you are aware of other tools that provide audio conversion to streaming SWF, please let me know and I'll update this list. Also, please let us know your results as well your opinions of that particular application.

    Related threads:

    AVI movies within SWISH
    http://board.flashkit.com/board/show...hreadid=268343

    Using movie files (.avi, .mov, MPEG) in Swish
    http://board.flashkit.com/board/show...hreadid=270191

    Add a sync track to your Swish movie with Flix
    http://board.flashkit.com/board/show...hreadid=217421

    Streaming audio in SwisH ?
    http://board.flashkit.com/board/show...hreadid=164229


    Added 02-28-2002
    As per http://board.flashkit.com/board/show...hreadid=273618

    For those people who have followed the Synchronizing Sound in Swish threads and would like to give a try in Swish, I've made some synchronized SWF files in various frame rates for download.

    http://www.abke.com/downloads/SyncSilence_12fps.swf
    http://www.abke.com/downloads/SyncSilence_20fps.swf
    http://www.abke.com/downloads/SyncSilence_25fps.swf
    http://www.abke.com/downloads/SyncSilence_30fps.swf
    http://www.abke.com/downloads/SyncSilence_35fps.swf
    http://www.abke.com/downloads/SyncSilence_40fps.swf
    http://www.abke.com/downloads/SyncSilence_45fps.swf
    http://www.abke.com/downloads/SyncSilence_50fps.swf


    Follow Cadence's tutorial above to see how to use these synchronized SWFs.

    For reference, I used Cooledit to create 2 seconds of silence, then saved as MP3 and imported the MP3 into Swideo to encode.

    I tried encoding directly from a WAV file but had no success, don't know if this is a bug in Swideo or something I was doing wrong.

    A list of other encoders are also listed above.

    Have fun!



    [Edited by LisaA on 02-28-2002 at 03:35 PM]

  10. #30
    Member
    Join Date
    Nov 2001
    Posts
    76
    Hi RodB

    within reason meaning you can get it to a point where it is acceptable not perfect but ok
    I think the misunderstanding here is our definition of the term “within reason”.

    Where would you draw the line to where it wasn’t “within reason”? This kind of reminds me of the story where the ostrich sticks his head in the sand. Since ALL .SWF files are CPU dependant it’s a simple matter of math and getting a ratio of slower old machines (which can’t view the .SWF files). VS. new computers (which can view the .SWF files better). Perhaps you and others are under the illusion that most people today own a newer computer. Well you might just want to research this point a little further, because the sad truth of the matter is that over 87% of all computers connected to the net are of the Pentium II family or older (according to Intel). Some countries still don’t have computers (yes I know it’s sad, but true). This being the case the bottom line is that 87% of the people who visit your web site world wide will see a movie that looks much like those old dubbed Chinese movies that play late in the night. You know the ones, where their mouth moves but no words come out, and then they stop talking and you hear what they said When they see this, is the word professional or UNprofessional going to cross their minds?

    Unfortunately you can’t control who visits your web site. It would be nice to have only Pentium III or Pentium 4 owners to view the ‘movies’ but we both know that sadly this isn’t possible. Now you do the math, do you still think that your “synced” movie will be viewed “within reason” knowing that 87% of the people who see it will not see anything synced at all? And when a customer from that 87% pool visits a web site and they see these out of sync movies playing, do you really think that they will stay at your web site very long, or just move on to another web site with the click of a button? It’s hard enough to get someone to visit your web site these days, and when you get someone there do you really want 87% of them to think that you might be unprofessional, and then click their mouse and leave your web site, all because of a out of sync movie?

    Don’t get me wrong, I wish there was a way for at least 50% of the people on the net to view “somewhat synced movies”, but there isn’t, unless you want to buy 87% of the population Pentium III or 4 machines, or spend really big bucks and get Shockwave (I’m not sure which would cost you less ). Shockwave isn’t CPU dependant. But hey, don’t let me deter you from inventing a way to sync .SWF files for that 87% with older and slower machines. Edison was told that he was a failure before he invented the car battery. He tried thousands of times and kept failing. When asked by a reporter how it feels to have failed, Edison responded with “I have not failed. I now know thousands of ways NOT to make a car battery”. A week later he invented what we now know as the car battery. I hope one of you creative .SWF Edison’s reading this can invent a way for .SWF files to not be CPU dependant. I’m sure that Macromedia would really appreciate it

    Enjoy your day.

  11. #31
    Senior Member
    Join Date
    Jul 2001
    Location
    Queensland Australia
    Posts
    283
    Hi Guys
    I suppose to end this l better explain what l mean by within reason

    First of , in my case l am referring to standalone projectors running from a cd-rom .

    This particular job is a slideshow that runs for 2min 25sec
    and has a pacy Tommy Emmanuel backing track that has been shortened with an echo that fades out on the end .
    If you place this track in swish with a play sound ,the movie will finish the sound way in front of the animation and its terrible really bogging down at some heavy fades .

    When the sound is encoded with Flix , it finishes in the frame of animation it is supposed to which gives a nice clean ending , during the movies running l have segments of the song that are matching areas of the movie ( a certain slide ) l say areas because l dont lock my sync into to a fine point , l try and allow about 20 to 30 frames of leway ,this movie is at 30fps , what this does is give the illusion of spot on sync , from what l can gather its not dropping that many frames of animation to keep up with the sound .

    This one was built on a Athlon 1.4 machine ,and has been tested on a P11 400 and a pentium 233 , it behaves the same as far as its music start and end and the areas of upbeats match the chosen slide on all 3 machines , the only difference l can see is that the faster machines run it with smoother animation the slower machines run a bit choppy or jerky , but the mr average person l work for dont even notice it , this is to me " within reason " l've been paid for the job and all is happy

    Regards Rod

  12. #32
    Senior Member
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    869
    My $02...

    I've tested the example Cadence posted on 3 different machines, as well as one I created which is very similar to Cadence's, and visually they are all in sync to the music.

    Machine specs:

    1) Dual 1ghz Pentium III, Elsa Gloria III Video Card w/64 meg of RAM, 3 18gig Ultra Scusis
    2) Dual Pentium Pro 2ghz, Matrox Millinium 8 meg Video w/256 meg of RAM, 3 6gig IDE Drives
    3) AMD K62 350mhz, Cheap Video Card w/198 meg of RAM, 6gig IDE Drives

    I'm no expert at this but the things that I see that will determine how the movie/sound plays is:

    1) Connection speed
    2) CPU speed (since it's saved to your hard drive)
    3) Type of Hard drive (because reading the data from a Scusi hard drive takes less load from the CPU then reading data from an IDE)
    4) I also think Video capabilities plays into this because of the efficiency in how it is displayed

    Now this information may be irrelavant for simple animations but may come into play for animations that use complex effects.

    The other thing to keep in mind is that the people who will be watching these movies are not sitting there timing everything to the second as we are attempting to do so "within reason" is not too bad if your audience sees your movie and visually it "appears" to be in sync with the music.

    If anyone cares to put together a more graphical, complex movie using this technique, or if you already have one, we would all love to see it.






  13. #33
    Swishmeister
    Join Date
    Sep 2000
    Location
    ... in a van ...down by the river.
    Posts
    25
    That's interesting Lisa, because I viewed the same movie on a computer at a school the other day, and it was well over ONE AND A HALF seconds off in the timing

    It was funny to watch, but I don't think that was the intention of the movie maker

    I must be in that 87% group


  14. #34
    Swiftdev Founder 98svt's Avatar
    Join Date
    May 2001
    Location
    Royal Oak, Michigan
    Posts
    2,139
    This may be way off, but if you have dreamweaver, there is an extension that converts mp3 files to swf.
    Just a thought.

    Like I stated in a previous thread, I just bought swideo 3.0, haven't tested it's capabillities as of yet, but I will soon, when I do, i'll post some feedback on it.

    Mike

  15. #35
    Senior Member Cadence's Avatar
    Join Date
    Aug 2000
    Location
    Columbus, Ohio
    Posts
    3,428
    Okay, here are some facts ...

    Sound-Synchronization using SWiSH alone, is impossible ... If one tries to accomplish this, they will fail with a thunder ...

    Sound-Synchronization using the methods described in this thread, is the ONLY way to do it (as far as I know) ...

    This method works a million times better than without it ...

    This is the closest we have been able to come to this goal -- which is one of the most asked questions here in the help forum ...

    Take it or leave it ... If you want to get your synchronization as close as it can possibly get, then use this method -- but please don't knock our efforts ... All we have supplied here are options ...

    You make the call :

    Using the Streaming Method :
    http://www.purifiedproductions.com/f...eamingmoe.html

    Without the Streaming Method :
    http://www.purifiedproductions.com/f...amlessmoe.html

    There is a HUGE difference in the two regardless of the system specs.

    Lisa, I want to thank you for all the time and effort you have put into this -- and, I'm glad you asked this question. From now on, when anyone has a question about audio synchronization - I will direct them to this thread -- there's a lot of information here.

    Enjoy,
    Cadence

  16. #36
    Flashkit historian Frets's Avatar
    Join Date
    Oct 2000
    Location
    flashkit
    Posts
    8,797
    Originally posted by AngelArs
    That's interesting Lisa, because I viewed the same movie on a computer at a school the other day, and it was well over ONE AND A HALF seconds off in the timing

    It was funny to watch, but I don't think that was the intention of the movie maker

    I must be in that 87% group

    Lisa covered those point on connection and processor speed.
    School is a funny place some have T1's some have T3's and some have dsl. Your on a lan which means you have to share irregular bandwidth with fellow students, faculty and staff.
    The distribution of bandwidth on a lan is always changing, as multiple users are requesting various files from the same line. As well colleges can not afford to upgrade systems every 6 months when there is an advance in computers/networking or for that matter every three years which is the standard with casual home users.

    Several years ago a college student responded that her site loaded much faster then mine did from her school. At that time we did a test. On a 56k dial-up we checked the download rate of her site against mine as we were both up for designing a site. Low and behold her site downloaded 10 times slower then mine. The reason she drew the conclusion was becaused she had viewed her and my site on her lan.

  17. #37
    Swishmeister
    Join Date
    Sep 2000
    Location
    ... in a van ...down by the river.
    Posts
    25
    Sorry, I should have been more clear. The computer that I was on at the school was not shared, and had it's own 56K modem. I'm glad you guys are working on this, even if it only works for about 15% of the population, but you've got to start somewhere

  18. #38
    Swiftdev Founder 98svt's Avatar
    Join Date
    May 2001
    Location
    Royal Oak, Michigan
    Posts
    2,139
    Cadence, the streaming version is dead on. Ther other is off, as expectecd.
    Excellent thread to add to "My Flashkit"

    Mike

  19. #39
    SWiSHer extraordinaire
    Join Date
    Dec 2000
    Location
    Australia
    Posts
    3,900
    Originally posted by SwishTopia
    we have been in direct contact with Macromedia over this very same issue. They themselves told us that it is not possible to do. They said;

    …different CPU processors will process .swf files differently. They cannot sync.
    They're not telling you the whole truth. I gave a post some time ago about the differences between streaming synchronised soundtrack and event-driver sound.

    Event-driven sound trigger the start of sound playback when an event happens (reaching a frame, or mouse events) .. that sound then plays independantly of the SWF file (unsynchronised). The sounds is defined (earlier) in one big lump.

    Streaming synchronised soundtracks embed the sound piece by piece in separate frames of the animation. The audio is tightly linked to the animation .. a certain piece of sound always plays with a give frame. Because SWF animation is processor dependant, the animation may fall behind the audio. In that case, Flash Player will skip frames until it catches up (that's how its kept in sync).

    NOW... if there is ANY streaming synchronised soundtrack playing (even if it is silence) in any timeline (sprite, level etc) .. then the SWF animation will synchronise to that sound. That mean even event-driven sounds will end up synchronised becaue that SWF animation is synchronised. You can imagine that the streaming synchronised sound is providing a regular heart-beat for the whole SWF.

    So .. a SWF with a fraction of a second of silent synchronised soundtrack (can be VERY small) that just plays continually will synchronise the movie.

  20. #40
    Junior Member
    Join Date
    Apr 2001
    Posts
    20

    I have test free • Swift-MP3

    I have test this program and it run very well. It is a DOS command line program, you can do drag and drop your mp3 onto the program and it will encoding it to swf but on the defualt 10fps, when you use command line you can specific what rate (fps). It has limited function but it is free.

    Cadence:
    I have try to fellow your tut, but unsucessful, what I did is:

    1.I don't have any preloader,
    2.load the silent.swf (2sec of silent sound) into the Spirit as you did
    3.at frame 10 of main timeline add action playsound (import test.mp3) in timeline
    4.the rest is as you calculate the timing for text effect to test sync.

    result:
    when I test with Projector, it play straight in the music, so it is not sync with the text.

    but I also try RodB's method

    1.so instead of making of silent.swf. I make the whole test.mp3 into test.swf with Swift-MP3.
    2.and then add new Spirit name "blank" as you did
    3.in frame 1 add action load movie test.swf and select spirit that make level -1
    4.in frmae 2 add action stop
    5.in main timeline "blank" Spirit frame 10 add place effect
    6.add text effect according to the music
    and it work this way

    Cadence did I miss anything that make it not work with your method??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center