我用Windows的WMP控件实现了视频的音轨切换,还想实现字幕切换,没找到接口,哪位高手知道?

东方之珠 2020-07-09 10:03:12
我用Windows的WMP控件实现了视频的音轨切换,用的WMP对象库的接口IWMPControls3
。还想实现字幕切换,对象库里面没找到操作字幕的接口,太郁闷了,哪位高手知道?是不是要安装什么插件才会有,我都不清楚。

我想自己实现字幕操作,不想去点DirectVobSub托盘图标菜单,那是别人的东西:

Dim WMPAudioLanguage As IWMPControls3
Set WMPAudioLanguage = WindowsMediaPlayer1.Controls
'获取所有语言音轨
If WMPAudioLanguage.audioLanguageCount > 1 Then
PlayScreen.AudioLanguageList.Visible = True
For i = 1 To WMPAudioLanguage.audioLanguageCount
'获取语言音轨名称
If i <= 1 Then
PlayScreen.AudioLanguageNumber(i - 1).Caption = "Audio " & i & ":" & WMPAudioLanguage.getLanguageName(WMPAudioLanguage.getAudioLanguageID(i))
PlayScreen.AudioLanguageNumber(i - 1).Visible = True
Else
Load PlayScreen.AudioLanguageNumber(i - 1)
PlayScreen.AudioLanguageNumber(i - 1).Caption = "Audio " & i & ":" & WMPAudioLanguage.getLanguageName(WMPAudioLanguage.getAudioLanguageID(i))
PlayScreen.AudioLanguageNumber(i - 1).Visible = True
End If
Debug.Print "语言数:" & WMPAudioLanguage.audioLanguageCount & " 语言:" & i & WMPAudioLanguage.getLanguageName(WMPAudioLanguage.getAudioLanguageID(i)) & " 描述:" & WMPAudioLanguage.getAudioLanguageDescription(i)
Next
For i = 1 To WMPAudioLanguage.audioLanguageCount
If (InStr(1, WMPAudioLanguage.getLanguageName(WMPAudioLanguage.getAudioLanguageID(i)), "中国") > 0) Or ((InStr(1, LCase(WMPAudioLanguage.getLanguageName(WMPAudioLanguage.getAudioLanguageID(i))), "chinese") > 0)) Or ((InStr(1, LCase(WMPAudioLanguage.getLanguageName(WMPAudioLanguage.getAudioLanguageID(i))), "简体") > 0)) Then
WMPAudioLanguage.currentAudioLanguageIndex = i
PlayScreen.AudioLanguageNumber(i - 1).Checked = True
Exit For
End If
Next
End If
...全文
159 回复 打赏 收藏 举报
写回复
回复
切换为时间正序
请发表友善的回复…
发表回复
相关推荐
发帖
多媒体
加入

807

社区成员

VB 多媒体
社区管理员
  • 多媒体
申请成为版主
帖子事件
创建了帖子
2020-07-09 10:03
社区公告
暂无公告