在Pygame中播放音乐会导致断言失败消息 [英] Playing music in Pygame causes an assertion failure message

查看:184
本文介绍了在Pygame中播放音乐会导致断言失败消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Pygame播放音乐时遇到麻烦.我输入:

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)

但我收到此消息:

Assertion failed!

Program: C\Python33\pythonw.exe

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

Expression: audio->rawdatawriteoffset > len

然后它告诉我看C ++文档.这不是音乐的负载,而是导致信息的播放.我也尝试了不同的音乐文件.

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.

推荐答案

只是更新,我遇到了同样的错误,但是我尝试播放不同的mp3并获得成功.我从此处

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

因此,似乎并不是所有的mp3文件都可以播放.

So, it seems not all mp3 files are playable.

希望它会有所帮助:)

这篇关于在Pygame中播放音乐会导致断言失败消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆