Playing music in Pygame causes an assertion failur

2019-08-23 05:44发布

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条回答
戒情不戒烟
2楼-- · 2019-08-23 06:24

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 :)

查看更多
登录 后发表回答