2014-03-18 52 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本身獲取音頻流給其他人以記錄它。