import pygame, time from pygame.locals import * soundObj = pygame.mixer.Sound('beeps.wav') soundObj.play() time.sleep(1)
and this causes 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 in which the code is located.
I donโt understand why this will not work!
source share