This content has been marked as final. Show 11 replies
WOW! That's all I can say right now.
In an attempt to get a grip on this situation and understand more about what it's doing, I loaded a song file into windows media player and started it at the same time the same song is playing from within Director. They played exactly the same and so did the synched artwork in director. Everything synched up perfectly. If I don't play the windows media file, the song within Director plays slightly faster thus making the timed artwork off synch (the longer it's played, the more off synch it becomes)
Clearly, there is something that happens that is making Director understand the proper playback speed if windows media player is already running. If it is not, then it will play it incorrectly. (most of the time, occasionaly it will play it correctly)
Does anyone with audio understanding know how to get around this bug in Director? Is there a way to initialeze the audio engine or tell it at what exact speed to play at?
How are you trying to synchronise the vision & audio? What are the 'events triggered'?
From many years of working with Director I would suggest that it is much more likely that the vision is varying, rather than the audio. Director vision is rendered in real-time and frame rates are more of a target rate (and a rough one at that).
If you are using waits or frame rates to try and sync, don't. You should be using cue points or lingo. These will look at the current time of the audio as it is playing, regardless of speed and allow you trigger events from that. I've used Lingo to sync video and audio many time with excellent, reproduceable results.
Yes, I am using lingo and cue points. That most definately is not the problem, nor is it the events or artwork that is getting out of synch. It is the audio file that is playing at different rates. I can change the playback rate by changing the compression of the mpg or swa or avi or wav (I have tried them all at various rates, bit depths, etc). This changes the duration of the song file, albiet very little, but enough to make it unusable for my needs. This is the problem. However, Director plays the same audio file sometimes at the correct speed and sometimes slightly too fast. I can force it to play the correct speed by opening windows media player and have that running in the background at the same time. if it's playing the same file, and I then play the song in Director, the song will be played back correctly and all events are synchronized.
The differences are not something the human ear can detect it is only apparent when you have many events cued based on milliseconds over a period of several minutes (a song) (I'm trying to display lyrics to a song as it is sung)
I can also make the audio file (song) play slightly slower than the events by using a lower compressions/bit rate. I can then make it play perfect by simply opening the same song in windows media player and having it run in the background. Very, very strange. So either way, whether the file is compressed at a high rate or slow rate and plays slightly faster or slower than it should, it will play perfectly if the same file is first opened, then played simultaneously with the media player.
I can also sometimes get the game to play the song file correctly if I preload the song and play it once just before I start the game. Unfortunately, that method is not consistent either.
This probably is totally crazy but it is MOST definately the audio file playing at different speeds.
Can you post a test movie?
unfortunately not since my movie is about 90 mb at the moment. It's easy enough to try though, just record an audio file with yourself saying the seconds every so often (such as 1, 5, 10, 15...) for about 3 minutes. Then add cue points at those same points. In Director, use lingo to display anything (text, graphic, etc...) on cuepassed.
I'm fairly certain it has something to do with anomalies during initial decompression. It somehow determines a rate at initial playback and then sticks with it. It's not inconsistent in that the speed varies during playback, it is inconsistent at which speed it chooses to playback at. In other words, I can see within the first 5 seconds whether it is going to be spot on or whether it's going be off. When it's off, it's always off by the same amount. That much is consistent.
Cue points are not arbitrary but compression/decompression apparently can have errors and nuances. When using the file in windows media first/simulaneously, those errors or nuances don't exist. It's seems to be an innaccuracy in the way Director handles compressed audio files as it initializes the playback of an audio file.
I have tried embedding the sound file (internal cast) as well as a linked cast and also playing the file from the hard drive. I have tried using puppetsound and sound.play(). No difference.
There has to be a work around otherwise 6 months of work is shot.
So are you saying that the file doesn't actually vary in speed but that there seems to be an offset appearing intermittently?
Are you using a script for cuepoint management or the tempo channel? What if you just created a simple script that has a simple put statement in an on cuePassed handler?
Are you going to different markers on the cues. What is actually being triggered?
I really don't know how else to explain it.
The offset is because of the song file being played at the incorrect speed. At first there is no offset, everything lines up perfectly when the song starts. As the song plays, the difference becomes more and more apparent.
lyrics are being cued. There is a cue point for every word in a song. The cue points are placed by sound forge. I tried embedding them in the song file (see other post about all the different options I have tried here) and using the cuePassed function as well as the current method of exporting the cue points to a file that Director reads. Doesn't matter. All that stuff doesn't matter if the song is actually played back at 2 different speeds.
I understand. What are you using to playback the swa - Import, or Insert? Have you tried other audio formats?
If you want to email me directly I can give you an address to upload a test, and I'd be willing to look at it.
Thanks John, that's considerate of you.
However, at 6am this morning I determined what the problem is. Compression. When a file is compressed it will play back slightly differently (slightly faster) When I added cue points, I added it to the master file (compressed but not as much as the final mp3 file). When the file is compressed, the cue points apparently don't change, they keep their static numbers while the actual audio file itself will change a bit, thus introducing small errors that compound themselves the longer the file is. I edited the cue points using the final mp3 file and now everything lines up perfecty in synch.
The only question I still have is why did Director play the game perfectly synched up when windows media file had the same song opened in the background? Why did it sometimes play it perfectly even with nothing else running except Director? I have no clue but as long as it plays correctly now, that's all I'm concerned about.
For those adding cue points, please remember to add them to the actual file you will use and don't try to recompress it or you will have timing errors.
Hope this helps future users....