国产探花免费观看_亚洲丰满少妇自慰呻吟_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程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 彭山县| 平远县| 定边县| 丹阳市| 荆州市| 白玉县| 德江县| 木里| 惠来县| 平安县| 泾源县| 柯坪县| 横山县| 屏东市| 四平市| 洪洞县| 江华| 临沂市| 河东区| 松溪县| 彰化县| 福鼎市| 巴里| 石楼县| 开封县| 盐源县| 多伦县| 鄄城县| 泸定县| 华蓥市| 韶关市| 泸西县| 施秉县| 谢通门县| 秦皇岛市| 依安县| 黄石市| 开鲁县| 印江| 宝鸡市| 阆中市|