0

I am making a game and I want to start a sound as the animation begins, but right now, it first plays the sound and then does the animation. Is there a way to do this so that both happen together?

1 Answers1

0

If you want to create a game, you should probably use pygame, which can play sounds in the background and much more. If that's too complicated for your use case, you can use sounddevice.play(), which by default plays asynchronously:

import sounddevice as sd
sd.play(mydata, 44100)
Matthias
  • 4,524
  • 2
  • 31
  • 50