Ankit404butfound / Piano

1 stars 1 forks source link

Sync in sound #2

Open nikhilCad opened 3 years ago

nikhilCad commented 3 years ago

When you start typing keys like crazy, the audio files cut each other. You should play all keystroke till their end instead of cutting the audio play in between.

nikhilCad commented 3 years ago

https://stackoverflow.com/questions/33574945/how-to-play-multiple-sounds-simultaneously-using-winsound/48456386

As per this, winsound does not seem to support this. But this should be a basic feature for piano

nikhilCad commented 3 years ago

Using pygame is best option, if you want to do it. Feel free to ignore.

Ankit404butfound commented 3 years ago

Yes, pygame should work, I haven't tried because I was just testing the code and also the real piano also cuts the sound, I guess, not sure.

Ankit404butfound commented 3 years ago

Also, adding a time delay of 0.5 seconds should work too.

nikhilCad commented 3 years ago

Also, adding a time delay of 0.5 seconds should work too.

Not exactly, all it does is prevent users from spamming keys on the keyboard. Multiple sounds are simply not supported in winsound

Ankit404butfound commented 3 years ago

Ok, I will better use pygame.