使用playsound+os路径时出错python



我在我的游戏中使用这行

playsound(os.path.join(os.path.dirname(__file__) , 'asset', C1 + '.mp3'))

它在linux上运行良好,但在windows上我得到了输出:

raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException: 
Error 275 for command:
open "E:testassetsound3.mp3" alias playsound_0.4871568054138944
Cannot find the specified file.  Make sure the path and filename are correct

当我键入全路径时

Error 277 for command:
open "E:JPssetound3.mp3" alias playsound_0.511238440569949
A problem occurred in initializing MCI.

检查命令提示符或文件资源管理器中是否存在该文件。该文件应该存在于您期望的文件夹中。

最新更新