我经常使用pygame,但以前从未使用过声音。我已经检查过,并且文件的名称正确,并且使用了正确的路径,但是我只收到以下错误消息:
回溯(最近通话最近):
模块中第11行的文件“ C:\ Users \ Rajive \ AppData \ Local \ Programs \ Python \ Python3.4.3 \ DCW.py”
door_opening = pygame.mixer.Sound('C:\ Users \ Rajive \ Downloads \ door_opening.m4a')
pygame.error:无法打开文件'C:\ Users \ Rajive \ Downloads \ door_opening.m4a'
import random, time, pygame
time = time.clock()
pygame.init()
diff = 1
door_opening = pygame.mixer.Sound('C:\\Users\\Rajive\\Downloads\\door_opening.m4a')
door_closing = pygame.mixer.Sound('C:\\Users\\Rajive\\Downloads\\door_closing.m4a')
closet_opening = pygame.mixer.Sound('C:\\Users\\Rajive\\Downloads\\closet_opening.m4a')
closet_opening = pygame.mixer.Sound('C:\\Users\\Rajive\\Downloads\\closet_closing.m4a')
window_opening = pygame.mixer.Sound('C:\\Users\\Rajive\\Downloads\\window_opening.m4a')
window_opening = pygame.mixer.Sound('C:\\Users\\Rajive\\Downloads\\window_closing.m4a')