import pygame, time
from pygame.locals import *
soundObj = pygame.mixer.Sound('beeps.wav')
soundObj.play()
time.sleep(1) # wait and let the sound play for 1 second
soundObj.stop()
and it throws this error:
Traceback (most recent call last):
File "C:/Users/Jauhar/Desktop/Python/sounds.py", line 4, in <module>
soundObj = pygame.mixer.Sound('beeps.wav')
pygame.error: Unable to open file 'beeps.wav'
The beeps.wav file is saved in the same directory as the python file the code is in.
I can't understand why it won't work!