Bugs with sound and music


#1

So one day, I was trying to make music with hopscotch, but there are several things that I don’t get. When it says “start sound and wait #”. Does the number count off in milliseconds?

Also, I found out that one block playing a sound and waiting 200 isn’t the same time as two blocks playing a sound and waiting 100. Does anybody know what’s wrong?


#2

First


#3

Huh thats strange

Idk


#4

Why was this flagged lol


#5

Yes, things are in milliseconds. Also, when it says “wait #” in a sound block, that refers to how long that song will play. If you want to wait before, after, or between sounds, use the actually wait block in the control flow section


#6

Like @sophia71205 said, you should set the “… and wait”-field to zero and just use a “Wait ___ milliseconds” block instead. This is still pretty weird though.


#7

But of you use a wait 500 in the sound block, the sound will play for half a second (I think)


#8

It’s still the same just leave it at 500 that’s what I did when I made birthday music!:grinning:


#9

I think so, but I am not too sure. After some thinking, I think that the “wait” value in the “Play sound” block acts the same as a regular “Wait” block.


#10

it does, the samples play once. you cant change how long thry play


#11

That happened too me just today can somone on hopscotch help me my name is oof oof


#12

Idk. Either because it is kind of hard try to email hopscoth see if the respond because when i was having troubles with hopscoth the helped me


#13

@Ambush @sophia71205 @William04GamerA @Ducks_Happy @memorablechickenyay @Iamtrash

As others have said, the number is milliseconds & the sound plays for however long it is regardless of the “and Wait” #

However, what the Wait # represents is how long the Player waits before continuing on to the next code block from the start of the sound.

So, for example, Start Sound and Wait 0 (just like the regular Wait 0 would continue the code on the next “frame”. At 60 fps, that would be 16.7 milliseconds (1/60) later. If the next block was a second Play Sound this would play 2 sounds at almost the same time.

If you want 2 sounds to play one after the other, the 1st Wait # would need to correspond to the length of the 1st sound which you could find through trial and error (just keep adjusting the Wait # until it sounds right).

Using other values (shorter than the length of the 1st sound) can either created layered sounds with a lag as specified by the Wait # or (longer than the length of the 1st sound) delays between the sounds.


#14

Okay that was very helpful too me


#15

Thanks :pray: for that information


#17

If there is a wait, it’s always in milliseconds