国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

python使用win32com庫播放mp3文件的方法

2020-02-23 01:29:14
字體:
來源:轉載
供稿:網友

本文實例講述了python使用win32com庫播放mp3文件的方法。分享給大家供大家參考。具體實現方法如下:

# Python supports COM, if you have the Win32 extensions# check your Python folder eg. D:/Python23/Lib/site-packages/win32com# also http://starship.python.net/crew/mhammond/win32/Downloads.html# this program will play MP3, WMA, MID, WAV files via the WindowsMediaPlayerfrom win32com.client import Dispatchmp = Dispatch("WMPlayer.OCX")# use an mp3 file you have ...#tune = mp.newMedia("C:/Program Files/Common Files/HP/Memories Disc/2.0/audio/Swing.mp3")# or copy one to the working folder ...#tune = mp.newMedia("Bier1.mp3")# you can also play wma files, this cool sound came with XP ...tune = mp.newMedia("C:/WINDOWS/system32/oobe/images/title.wma")mp.currentPlaylist.appendItem(tune)mp.controls.play()# to stop playing useraw_input("Press Enter to stop playing")mp.controls.stop()

希望本文所述對大家的Python程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 磐安县| 孟州市| 宣武区| 青阳县| 宝坻区| 金堂县| 福泉市| 云南省| 凤凰县| 马山县| 谷城县| 哈尔滨市| 开平市| 文水县| 南岸区| 涞源县| 崇州市| 长顺县| 黄石市| 公主岭市| 无锡市| 徐水县| 阆中市| 安平县| 扶绥县| 阿拉善盟| 南江县| 交城县| 长岛县| 赫章县| 钦州市| 顺义区| 铜川市| 天祝| 玉溪市| 湖南省| 上栗县| 马龙县| 桐庐县| 军事| 台湾省|