Playing music in Pygame causes an assertion failure message

我只是一个虾纸丫 提交于 2019-12-25 17:47:30

问题


I'm having trouble playing music in Pygame. I type:

pygame.mixer.music.load("Maid with the Flaxen Hair.mp3")

pygame.mixer.music.play(-1, 0.0)

but I get this message:

Assertion failed!

Program: C\Python33\pythonw.exe

File:..\..\audio\mpegtoraw.cpp
Line: 505

Expression: audio->rawdatawriteoffset > len

Then it tells me to see C++ documentation. It's not the loading of the music, it's the playing that causes the message. I tried different music files too.


回答1:


Just to update, I had the same error but I tried playing different mp3s and got success with one. I downloaded a sample mp3 from here

So, it seems not all mp3 files are playable.

Hope it helps :)



来源:https://stackoverflow.com/questions/18393526/playing-music-in-pygame-causes-an-assertion-failure-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!