|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
如图
在预加载音乐的时候出错
不能传图片了QAQ
主代码:
- import subprocess
- import pygame
- h = -1
- #初始化
- pygame.init()
- #预加载bgm
- pygame.mixer.music.load("bad_apple.ogg")
- with open("badapple.txt") as batxt:
- read = batxt.read().split("\n")
-
- print("bad apple")
- input("回车开始")
- #播bgm
- pygame.mixer.music.play("bad_apple.ogg")
- while h < 229880 :
- subprocess.call("cls",shell = True)
- b = -1
- while b < 34:
- h = h + 1
- b = b + 1
- print(read[h])
- #淡出
- if b >840 :
- pygame.mixer.music.fadeout(10)
-
- print("播放完毕")
- input("回车结束")
复制代码
错误码:
- Traceback (most recent call last):
- File "C:\Users\Administrator.WIN7-1704041035\Desktop\python程序集\bad apple\bad apple2.py", line 19, in <module>
- pygame.mixer.music.play("bad_apple.ogg")
- TypeError: an integer is required (got type str)
复制代码 |
|