📜  python 在后台播放 mp3 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:45.631000             🧑  作者: Mango

代码示例2
#You First Need To Do This In Your Python Terminal: "pip install pydub"
from pydub import AudioSegment
from pydub.playback import play
import threading

sound = AudioSegment.from_wav('myfile.wav')
t = threading.Thread(target=play, args=(sound,))
t.start()

print("I like this line to be executed simoultinously with the audio playing")