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

首頁 > 編程 > Python > 正文

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

2019-11-25 17:21:01
字體:
來源:轉載
供稿:網友

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

# 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程序設計有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 保山市| 阳高县| 栾川县| 德保县| 和平县| 三原县| 弋阳县| 通海县| 尼木县| 吐鲁番市| 哈密市| 芦山县| 彭州市| 沂源县| 原平市| 岑溪市| 巴彦淖尔市| 裕民县| 潢川县| 西青区| 山丹县| 宁夏| 四子王旗| 贵德县| 瑞安市| 牡丹江市| 晋江市| 德昌县| 云安县| 新蔡县| 阿拉善盟| 都匀市| 大足县| 咸宁市| 增城市| 西乡县| 铁岭市| 嘉鱼县| 卫辉市| 枣庄市| 乌兰察布市|