A
atemphot
Unregistered / Unconfirmed
GUEST, unregistred user!
各位好!
我使用TAPI2.2(操作系统是Window 2000) 来操作语音Modem(金网霸fm3711).
调用lineMakeCall(),当成功建立呼叫连接后, 我用lineGetID()分别获取"wave/in"和"wave/out"类型的设备ID(nInDeviceID 和 nOutDeviceID),
我想用它们来从电话线路录音,同时往电话线路播放WAV文件。
但是它们两者同一时刻只能有一个可用,
即 waveInOpen(...,nInDeviceID,...)
waveOutOpen(...,nOutDeviceID,...)这两个函数只有先调用的那个函数能成功,
而后调用的那个每次都失败,返回错误是:所请求的设备已在使用中。
是不是我的语音猫不是全双工的啊?
恳请那位TAPI编程前辈帮忙,指点迷津!!!
相关程序片断(VC++ 6.0)如下:
HWAVEIN hWaveIn = NULL;
HWAVEOUT hWaveOut = NULL;
UINT WaveInID = 0;
UINT WaveOutID = 0;
lineGetID(0, 0, hCall, LINECALLSELECT_CALL, pVarString, TEXT("wave/in"))
WaveInID = *(UINT *)((LPBYTE)pVarString + pVarString->dwStringOffset);
lineGetID(0, 0, hCall, LINECALLSELECT_CALL, pVarString, TEXT("wave/out"))
WaveOutID = *(UINT *)((LPBYTE)pVarString + pVarString->dwStringOffset);
mmResult = waveInOpen(&hWaveIn, WaveInID, pFormat, 0 , 0L, dwWaveMapped);
if (mmResult)
{
MyPrintf(TEXT("waveInOpen returned %s/r/n", FormatWaveOutError(mmResult));
goto end;
}
mmResult = waveOutOpen(&hWaveOut, WaveOutID, pFormat, 0 , 0L, dwWaveMapped);
if (mmResult) //该调用失败!!!
{
MyPrintf(TEXT("waveOutOpen returned %s/r/n", FormatWaveOutError(mmResult));
goto end;
}
我使用TAPI2.2(操作系统是Window 2000) 来操作语音Modem(金网霸fm3711).
调用lineMakeCall(),当成功建立呼叫连接后, 我用lineGetID()分别获取"wave/in"和"wave/out"类型的设备ID(nInDeviceID 和 nOutDeviceID),
我想用它们来从电话线路录音,同时往电话线路播放WAV文件。
但是它们两者同一时刻只能有一个可用,
即 waveInOpen(...,nInDeviceID,...)
waveOutOpen(...,nOutDeviceID,...)这两个函数只有先调用的那个函数能成功,
而后调用的那个每次都失败,返回错误是:所请求的设备已在使用中。
是不是我的语音猫不是全双工的啊?
恳请那位TAPI编程前辈帮忙,指点迷津!!!
相关程序片断(VC++ 6.0)如下:
HWAVEIN hWaveIn = NULL;
HWAVEOUT hWaveOut = NULL;
UINT WaveInID = 0;
UINT WaveOutID = 0;
lineGetID(0, 0, hCall, LINECALLSELECT_CALL, pVarString, TEXT("wave/in"))
WaveInID = *(UINT *)((LPBYTE)pVarString + pVarString->dwStringOffset);
lineGetID(0, 0, hCall, LINECALLSELECT_CALL, pVarString, TEXT("wave/out"))
WaveOutID = *(UINT *)((LPBYTE)pVarString + pVarString->dwStringOffset);
mmResult = waveInOpen(&hWaveIn, WaveInID, pFormat, 0 , 0L, dwWaveMapped);
if (mmResult)
{
MyPrintf(TEXT("waveInOpen returned %s/r/n", FormatWaveOutError(mmResult));
goto end;
}
mmResult = waveOutOpen(&hWaveOut, WaveOutID, pFormat, 0 , 0L, dwWaveMapped);
if (mmResult) //该调用失败!!!
{
MyPrintf(TEXT("waveOutOpen returned %s/r/n", FormatWaveOutError(mmResult));
goto end;
}