I am trying to play a wav file in my program by using pygame. However I get no sound despite having no errors pop up. The file is in the same project folder as my .py file (I am using PyCharm, but don't know if that is relevant).
import pygame
pygame.init()
def playsound(filename):
pygame.mixer.music.load(filename)
pygame.mixer.music.play()
playsound('my-file.wav')
I expected the sound file to play but it didn't. No errors were displayed.