我想知道是否有任何我可以播放一个声音,而不需要导入像pygame这样的外部库。像这样:
import os
import sound
mysound = sound.load("mysound.mp3") # gets the sound "mysound.mp3"
while True:
input("Press enter to play sound")
sound.play(mysound) # plays the sound mysound
os.system('cls') # clears the console
标准库有一些函数用于播放} 和Linux中稍微过时的^{} ),但没有加载{}文件的方法。在
.wav
文件(请参见Windows上的^{This question有几个答案,列出了用于播放声音的各种第三方模块。在
你不能。你需要一些图书馆。在
相关问题 更多 >
编程相关推荐