我正在尝试使用 c# 记录和保存 Skype 通话通信,但它只工作了一半。当我从 Skype 拨打手机号码并连接时,他们所说的内容不会被记录,但我所说的内容正在被记录和保存。
我只是不明白为什么没有记录和保存其他人的声音。这是我的代码:
public void Skype_CallStatus(Call call, TCallStatus status)
{
int result = 0;
Configuration config =
ConfigurationManager.OpenExeConfiguration
(System.Windows.Forms.Application.ExecutablePath);
if (status == TCallStatus.clsInProgress)
{
mciSendString("open new Type waveaudio Alias recsound", "", 0, 0);
mciSendString("record recsound", "", 0, 0);
}
else if (status == TCallStatus.clsFinished)
{
DateTime currdate = DateTime.Now;
string datetime = string.Format("{0:yyyyMMddhhmmss}.wav", DateTime.Now);
string wavfilename = "";
if (config.AppSettings.Settings["VoiceRecordsPath"].Value != null)
{
//wavfilename = config.AppSettings.Settings["VoiceRecordsPath"]
//.Value.Replace(",","") + "_" + CSRBusiness.User.Country + "_"
//+ datetime + @".wav";
wavfilename = CSRBusiness.User.Country + "_" + datetime;
}
Directory.SetCurrentDirectory( config.AppSettings.Settings
["VoiceRecordsPath"].Value.Replace(",", ""));
//result = mciSendString("save recsound " + wavfilename, "", 0, 0);
result = mciSendString("save recsound d://test.wav", "", 0, 0);
mciSendString("close recsound ", "", 0, 0);
MessageBox.Show(result.ToString());
}
// MessageBox.Show(result.ToString());
}
实际上,语音是从该区域录制和保存的:
else if (status == TCallStatus.clsFinished)
{
}
所以我需要帮助来弄清楚如何记录和保存通话的两端。我在哪里可以在我的代码中做到这一点?