Python Forum
[PyGame] Play Audio While continuing Gameplay
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Play Audio While continuing Gameplay
#1
I am new to game development.

I am making Snake game as my first game project. I want to play audio when snake eats food.

I tried doing using this:

from playsound import playsound
playsound("D:/Projects/Pygame/food.mp3")
When Snake eats food, sound is played but game freezes until sound is finished. How do i play sound and also continue gameplay at sametime? Do I need to use threading?
Reply


Messages In This Thread
Play Audio While continuing Gameplay - by apealunited - May-09-2019, 02:25 PM
RE: Play Audio While continuing Gameplay - by Yoriz - May-09-2019, 04:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I can not play mp3 in pygame vinicius 4 5,215 Feb-19-2018, 11:01 PM
Last Post: SeabassG33

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020