This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-05-31 00:12:13

ShadowDialga
New Scratcher
Registered: 2012-05-18
Posts: 13

Problem with synchronizing video and sound?

http://scratch.mit.edu/projects/ShadowDialga/2577520

When i run it in Scratch, it syncs up perfectly about half the time (the other half, the music starts playing a bit early). But when I run it in full-screen mode the visuals go faster than the music and end up finishing earlier than they're supposed to. Any ideas why? If so, please let me know or try to fix it and I will give you credit in the final version.

Offline

 

#2 2012-05-31 19:35:28

shpeters
Scratcher
Registered: 2011-12-11
Posts: 100+

Re: Problem with synchronizing video and sound?

It's likely to be a website bug. There are a lot of them including some sprites in my projects being able to go through walls or turning sideways. Just put "download it" in your project notes.


http://i.imgur.com/bboYO.pnghttp://i.imgur.com/66Yki.gifhttp://i.imgur.com/uLUsl.jpg

Offline

 

#3 2012-05-31 19:36:25

ShadowDialga
New Scratcher
Registered: 2012-05-18
Posts: 13

Re: Problem with synchronizing video and sound?

shpeters wrote:

It's likely to be a website bug. There are a lot of them including some sprites in my projects being able to go through walls or turning sideways. Just put "download it" in your project notes.

But when I play it in fullscreen on my computer or it's laggy it does the same so I think it's a scripting error...

Offline

 

#4 2012-05-31 19:43:59

shpeters
Scratcher
Registered: 2011-12-11
Posts: 100+

Re: Problem with synchronizing video and sound?

ShadowDialga wrote:

shpeters wrote:

It's likely to be a website bug. There are a lot of them including some sprites in my projects being able to go through walls or turning sideways. Just put "download it" in your project notes.

But when I play it in fullscreen on my computer or it's laggy it does the same so I think it's a scripting error...

I'm sure its not the project. I just downloaded it and the scripts looked fine. You also said it works half the time. Have you tried it on flash or a different computer?


http://i.imgur.com/bboYO.pnghttp://i.imgur.com/66Yki.gifhttp://i.imgur.com/uLUsl.jpg

Offline

 

#5 2012-06-01 00:02:17

ShadowDialga
New Scratcher
Registered: 2012-05-18
Posts: 13

Re: Problem with synchronizing video and sound?

shpeters wrote:

ShadowDialga wrote:

shpeters wrote:

It's likely to be a website bug. There are a lot of them including some sprites in my projects being able to go through walls or turning sideways. Just put "download it" in your project notes.

But when I play it in fullscreen on my computer or it's laggy it does the same so I think it's a scripting error...

I'm sure its not the project. I just downloaded it and the scripts looked fine. You also said it works half the time. Have you tried it on flash or a different computer?

It was always in flash

Offline

 

#6 2012-06-01 13:13:22

shpeters
Scratcher
Registered: 2011-12-11
Posts: 100+

Re: Problem with synchronizing video and sound?

I reanalyzed the script and realized what the problem was. The sound script is right after the costume script which means that it will start a very small amount of time (probably a fraction of a millisecond) after the background changes and 0.2 seconds after the second change in background. Lag makes gaps longer and probably did the same thing with the gap in between the script and the sound. I suggest either trying this on a computer with no lag or moving the sound to a separate script. If that doesn't work then I'm out of ideas.


http://i.imgur.com/bboYO.pnghttp://i.imgur.com/66Yki.gifhttp://i.imgur.com/uLUsl.jpg

Offline

 

#7 2012-06-02 11:46:00

ShadowDialga
New Scratcher
Registered: 2012-05-18
Posts: 13

Re: Problem with synchronizing video and sound?

shpeters wrote:

I reanalyzed the script and realized what the problem was. The sound script is right after the costume script which means that it will start a very small amount of time (probably a fraction of a millisecond) after the background changes and 0.2 seconds after the second change in background. Lag makes gaps longer and probably did the same thing with the gap in between the script and the sound. I suggest either trying this on a computer with no lag or moving the sound to a separate script. If that doesn't work then I'm out of ideas.

Easier said than done  tongue . How can I move the sound to a different thing?

Offline

 

#8 2012-06-02 12:23:50

Shinkaze
Scratcher
Registered: 2012-05-27
Posts: 44

Re: Problem with synchronizing video and sound?

As I think has been mentioned, full screen speeds up your scripts.
When your project is on-line, internet connection can affect your speed as well.

If you have this:

wait (1) secs
before your video starts, it could help. I know it seems general, but this is how I got my AMV working fine. Obviously, you can change the amount of time you wait depending on how much time you need. Keep experimenting and you should get there!

I also agree with shepters when he wrote that you should try

shepters wrote:

moving the sound to a seperate script.

Usually, having a master sound script, a master costume script and a master timing script can easily sort this out.
The master timing script can be like:

when gf clicked
broadcast [1]
wait (1) secs
broadcast [2]
and so on.

Hope this helps,
SK


http://thisisagoodbook.com/images/shinkazesig2.png

Offline

 

#9 2012-06-02 12:47:15

SimplyMelee
Scratcher
Registered: 2012-01-14
Posts: 100+

Re: Problem with synchronizing video and sound?

It's ok just a bit to fast you might want to slow it down by uploading unnecessary songs found on scratch resources


http://oi48.tinypic.com/2czzjol.jpg

Offline

 

Board footer