pygame音乐,不能读mp3? [英] pygame music, cant read mp3?

查看:125
本文介绍了pygame音乐,不能读mp3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://www.pygame.org/docs/ref /mixer.html


导入pygame

#pygame.mixer.init(频率= 22050,大小= -16,渠道= 2,

缓冲区= 3072)//它抱怨abiout words =

所以我猜它只有nbrs应该在那里//

pygame.mixer.init(22050,-16,2,3072)

pygame.mixer.music.load(" example1.mp3")

pygame.mixer.music.play(loops = 1,start = 0.0)


Traceback(最近一次调用最后一次):

文件C: \ Python25 \ myPrograms\pygameProgs \ musicexp.p y",第5行,

< module>

pygame.mixer.music.load(" ; example1.mp3")

错误:无法读取''example1.mp3''

http://www.pygame.org/docs/ref/mixer.html

import pygame

#pygame.mixer.init(frequency=22050, size=-16, channels=2,
buffer=3072) //it complained abiout words=
so i guess its only the nbrs should be there//

pygame.mixer.init(22050, -16, 2, 3072)
pygame.mixer.music.load("example1.mp3")
pygame.mixer.music.play(loops=1, start=0.0)

Traceback (most recent call last):
File "C:\Python25\myPrograms\pygameProgs\musicexp.p y", line 5, in
<module>
pygame.mixer.music.load("example1.mp3")
error: Couldn''t read from ''example1.mp3''

推荐答案

globalrev写道:
globalrev wrote:
http://www.pygame.org/docs/ref/mixer.html

导入pygame


#pygame.mixer.init(频率= 22050,大小= -16,频道= 2,

缓冲区= 3072)//它抱怨了很多单词=

所以我猜它只有nbrs应该在那里//


pygame.mixer.init(22050,-16,2,3072)

pygame.mixer.music.load(" example1.mp3")

pygame.mixer.music.play(loops = 1,start = 0.0)
<回溯(最近一次调用最后一次):

文件C:\Python25 \ myPrograms \ pygameProgs \ musicexp.p y,第5行,在

< module>

pygame.mixer.music.load(" example1.mp3")

错误:无法读取''example1.mp3''
http://www.pygame.org/docs/ref/mixer.html

import pygame

#pygame.mixer.init(frequency=22050, size=-16, channels=2,
buffer=3072) //it complained abiout words=
so i guess its only the nbrs should be there//

pygame.mixer.init(22050, -16, 2, 3072)
pygame.mixer.music.load("example1.mp3")
pygame.mixer.music.play(loops=1, start=0.0)

Traceback (most recent call last):
File "C:\Python25\myPrograms\pygameProgs\musicexp.p y", line 5, in
<module>
pygame.mixer.music.load("example1.mp3")
error: Couldn''t read from ''example1.mp3''



为它提供MP3的完整路径。注意向后斜线+需要

逃脱它们。


Diez

Give it the full path to the MP3. Be aware of backward slashes + the need to
escape them.

Diez


On 5 Maj,13:47,Diez B. Roggisch < de ... @nospam.web.dewrote:
On 5 Maj, 13:47, "Diez B. Roggisch" <de...@nospam.web.dewrote:

globalrev写道:
globalrev wrote:
http://www.pygame.org/docs/ref/mixer.html


import pygame
import pygame


#pygame.mixer.init(frequency = 22050,size = -16,频道= 2,

缓冲区= 3072)//它抱怨abiout words =

所以我猜它只有nbrs应该在那里//
#pygame.mixer.init(frequency=22050, size=-16, channels=2,
buffer=3072) //it complained abiout words=
so i guess its only the nbrs should be there//


pygame.mixer.init(22050,-16,2,3072)

pygame.mixer.music.load(" example1 .mp3")

pygame.mixer.music.play(loops = 1,start = 0.0)
pygame.mixer.init(22050, -16, 2, 3072)
pygame.mixer.music.load("example1.mp3")
pygame.mixer.music.play(loops=1, start=0.0)


Traceback(最近的电话最后一次):

文件C:\Python25 \ myPrograms\pygameProgs \ musicexp.p y,第5行,i n

< module>

pygame.mixer.music.load(" example1.mp3")

错误:无法从''example1.mp3'''读取
Traceback (most recent call last):
File "C:\Python25\myPrograms\pygameProgs\musicexp.p y", line 5, in
<module>
pygame.mixer.music.load("example1.mp3")
error: Couldn''t read from ''example1.mp3''



给它完整的MP3路径。注意向后斜线+需要

逃脱它们。


Diez


Give it the full path to the MP3. Be aware of backward slashes + the need to
escape them.

Diez



逃脱他们?


导入pygame

#pygame.mixer.init(频率= 22050,大小= -16,channels = 2,缓冲区= 3072)

pygame.mixer.init(22050,-16,2,3072)

pygame.mixer.music.load(''C:/ Python25 / myPrograms / pygameProgs /

example1.mp3'')

pygame.mixer.music.play(loops = 1,start = 0.0)

文件" C:\Python25 \ myPrograms \ pygameProgs \ musicexp.p y",第5行,

< module>

pygame.mixer.music.load(''C:/ Python25 / myPrograms / pygameProgs /

example1.mp3'' )

错误:无法读取''C:/ Python25 / myPrograms / pygameProgs /

example1.mp3''

escape them?


import pygame

#pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=3072)
pygame.mixer.init(22050, -16, 2, 3072)
pygame.mixer.music.load(''C:/Python25/myPrograms/pygameProgs/
example1.mp3'')
pygame.mixer.music.play(loops=1, start=0.0)

Traceback (most recent call last):
File "C:\Python25\myPrograms\pygameProgs\musicexp.p y", line 5, in
<module>
pygame.mixer.music.load(''C:/Python25/myPrograms/pygameProgs/
example1.mp3'')
error: Couldn''t read from ''C:/Python25/myPrograms/pygameProgs/
example1.mp3''


On 5 Maj,14:03,globalrev< skanem ... @ yahoo.sewrote:
On 5 Maj, 14:03, globalrev <skanem...@yahoo.sewrote:

On 5 Maj,13:47,Diez B. Roggisch < de ... @nospam.web.dewrote:
On 5 Maj, 13:47, "Diez B. Roggisch" <de...@nospam.web.dewrote:

globalrev写道:
globalrev wrote:

> http://www.pygame.org/docs/ref/mixer。 html


import pygame
import pygame


#pygame.mixer.init(频率= 22050,大小= -16,频道= 2,

缓冲区= 3072)/ /它抱怨abiout words =

所以我猜它只有nbrs应该在那里//
#pygame.mixer.init(frequency=22050, size=-16, channels=2,
buffer=3072) //it complained abiout words=
so i guess its only the nbrs should be there//


pygame.mixer.init(22050,-16,2,3072)

pygame.mixer.music.load(" example1.mp3")

pygame.mixer.music.play(loops = 1,start = 0.0)
pygame.mixer.init(22050, -16, 2, 3072)
pygame.mixer.music.load("example1.mp3")
pygame.mixer.music.play(loops=1, start=0.0)


回溯(最近一次调用最后一次):

文件C:\Python25 \ myPrograms \ pygameProgs \ musicexp。 p y,第5行,

< module>

pygame.mixer.music.load(" example1.mp3")

错误:无法读取''example1.mp3''
Traceback (most recent call last):
File "C:\Python25\myPrograms\pygameProgs\musicexp.p y", line 5, in
<module>
pygame.mixer.music.load("example1.mp3")
error: Couldn''t read from ''example1.mp3''


为它提供MP3的完整路径。注意向后斜线+需要

逃避它们。
Give it the full path to the MP3. Be aware of backward slashes + the need to
escape them.


Diez
Diez



逃脱它们?


import pygame


#pygame.mixer.init(频率= 22050,大小= -16,频道= 2,缓冲区= 3072)

pygame。 mixer.init(22050,-16,2,3072)

pygame.mixer.music.load(''C:/ Python25 / myPrograms / pygameProgs /

example1。 mp3'')

pygame.mixer.music.play(loops = 1,start = 0.0)


Traceback(最近一次调用最后一次):

文件C:\Python25 \ myPrograms\pygameProgs \ musicexp.p y,第5行,

< module>

pygame.mixer.music.load(''C:/ Python25 / myPrograms / pygameProgs /

example1.mp3'')

错误:无法读取来自''C:/ Python25 / myPrograms / pygameProgs /

example1.mp3''


escape them?

import pygame

#pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=3072)
pygame.mixer.init(22050, -16, 2, 3072)
pygame.mixer.music.load(''C:/Python25/myPrograms/pygameProgs/
example1.mp3'')
pygame.mixer.music.play(loops=1, start=0.0)

Traceback (most recent call last):
File "C:\Python25\myPrograms\pygameProgs\musicexp.p y", line 5, in
<module>
pygame.mixer.music.load(''C:/Python25/myPrograms/pygameProgs/
example1.mp3'')
error: Couldn''t read from ''C:/Python25/myPrograms/pygameProgs/
example1.mp3''



尝试使用\的文件名但是同样的结果。

tried filenames with \ also but same result.


这篇关于pygame音乐,不能读mp3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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