2014-03-18 49 views
0

我想记录&保存skype通话使用c#,但它只是在中途工作。 当我从Skype拨打手机号码并连接时,他们所说的内容没有被记录,但我所说的是正在记录&已保存。如何通过c#记录和保存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) 
{ 

} 

所以我需要搞清楚怎样做才能记录&保存通话两端的帮助。我在哪里可以在我的代码中执行此操作?

+1

可能http://stackoverflow.com/questions/10171547/can-we-record-sound-sent-to-speakers-using-c-sharp是你需要什么? – MattC

回答

2

mciSendString对Skype没有任何了解。它所做的只是记录电脑麦克风拾取的内容(不包括Skype中的其他用户)。

我希望你必须从Skype本身获取音频流给其他人以记录它。