I am just trying to do this really simple thing where I want to play two different sound files depending on a touch sensor. The problem that I currently have is that I cannot even play one of them without anything else, because 'the files cannot be opened'.
import pygame
pygame.mixer.pre_init(44100, -16, 12, 512)
pygame.init
slowbeat = pygame.mixer.Sound('/home/pi/gpio-music-box/samples/slowbeat.wav')
slowbeat.set_volume(.4);
fastbeat = pygame.mixer.Sound('/home/pi/gpio-music-box/samples/fastbeat.wav')
fastbeat.set_volume(.4);
slowbeat.play()
The traceback:
Traceback (most recent call last): File "/home/pi/a.py", line 11, in slowbeat = pygame.mixer.Sound('slowbeat.wav') pygame.error: Unable to open file 'slowbeat.wav'
pygame.init. - skrxpygame.mixer.init()beforepygame.init(). - skrx