偶是用《_multimedia.vcx》库的《_soundplayer》类作为播放器,其控制方式如下:
SET classlib TO .\ffc\_multimedia.vcx
_screen.AddObject("tpiam","_soundplayer") && 加载播放器对象
1、暂停、重播:
IF 控制变量1=1
控制变量1=0
thisform.重放"
thisform.接着播放刚才暂停的音频"
_screen.tpiam.PauseSound( ) && 暂停
ELSE
IF 控制变量2=1
控制变量1=1
_screen.tpiam.PlaySound( ) && 重放
thisform.暂停"
thisform.暂时停止播放音频"
ENDIF
ENDIF
2、播放器关闭文件并释放内存
_screen.tpiam.CloseSound() && 关闭文件
控制变量2=0
thisform. && 没有加载文件暂停键不能暂停不能重播所有隐藏。
3、查找、打开文件
mcax=GETFILE("wav,mp3,avi","选择文件","选定") && 查找文件
IF FILE(mcax)=.T.
控制变量2=1
_screen.tpiam.cFileName=mcax && 加载文件
_screen.tpiam.OpenSound( ) && 播放文件
控制变量1=1
thisform.暂停"
thisform. && “暂停、重播键”可见
thisform.暂时停止播放音频"
ENDIF
[[it] 本帖最后由 午丁 于 2008-6-24 22:43 编辑 [/it]]