I am trying to play a simple beat with the pygame.mixer
.
import os
import pygame
import pygame.mixer
# Initialize the game
pygame.init()
pygame.mixer.init() # frequency, size, channels, buffersize
print(os.listdir())
# ... some other stuff....
try:
sound = pygame.mixer.Sound("low_click.wav")
print('low_click.wav')
sound.play()
except pygame.error:
pass
The program just prints
['metronom_quintenzirkel.py', 'low_click.wav', 'data']
, so an exception occured.
What has gone wrong?