vc++中调用MCI录音函数的采样频率是多少?
答案:1 悬赏:0 手机版
解决时间 2021-12-30 13:27
- 提问者网友:我是我
- 2021-12-29 14:56
vc++中调用MCI录音函数的采样频率是多少?
最佳答案
- 五星知识达人网友:胯下狙击手
- 2021-12-29 15:43
直接用API函数mciSendString就行了:
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Sub Command1_Click()
'开始录音
Dim iRet As Long
iRet = mciSendString("open new type waveaudio alias MyRecord", 0&, 0, 0)
iRet = mciSendString("set MyRecord bitspersample 16 samplespersec 16384", 0&, 0, 0)
iRet = mciSendString("record MyRecord overwrite", 0&, 0, 0)
End Sub
Private Sub Command2_Click()
'保存录音
Dim iRet As Long
iRet = mciSendString("save MyRecord c:\1.wav", 0&, 0, 0)
iRet = mciSendString("close MyRecord", 0&, 0, 0)
End Sub
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _
(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Sub Command1_Click()
'开始录音
Dim iRet As Long
iRet = mciSendString("open new type waveaudio alias MyRecord", 0&, 0, 0)
iRet = mciSendString("set MyRecord bitspersample 16 samplespersec 16384", 0&, 0, 0)
iRet = mciSendString("record MyRecord overwrite", 0&, 0, 0)
End Sub
Private Sub Command2_Click()
'保存录音
Dim iRet As Long
iRet = mciSendString("save MyRecord c:\1.wav", 0&, 0, 0)
iRet = mciSendString("close MyRecord", 0&, 0, 0)
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯