Win7下使用WMEncoder.exe 64 实现录音,找不到WMEncoder.ProfileCollection
本帖最后由 ryueiketu 于 2012-08-30 09:16:26 编辑 我用WMEncoder.exe 和Interop.WMEncoderLib.dll开发了个小的录音功能。在XP下好用,
可是在Win7 64位下,出现初始化WMEncoder对象的错误,于是我又下了WMEncoder.exe 64,安装后,初始化可以了,但是找不到ProfileCollection下可用的资源文件了。。有知道的高手请指点。。急呀。。
代码
dim m_WMEncoder As New WMEncoder
Dim sg As IWMEncSourceGroup = m_WMEncoder.SourceGroupCollection.Add("SG_1")
sg.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO).SetInput("Default_Audio_Device", "DEVICE", "")
m_WMEncoder.File.LocalFileName = strSavePath
For i As Integer = 0 To m_WMEncoder.ProfileCollection.Count - 1
If m_WMEncoder.ProfileCollection.Item(i).Name = "Windows Media Audio 8 for Dial-up Modem (CD quality, 64 Kbps)" Then
sg.Profile = m_WMEncoder.ProfileCollection.Item(i)
Exit For
End If
Next
m_WMEncoder.PrepareToEncode(True)
m_WMEncoder.Start()
m_bIsRecording = True