Dictionary<int, string> voiceRecoding = new Dictionary<int, string>();
SKYPE4COMLib.Skype skype = new Skype();
skype.Attach(6, true);
skype.CallStatus += skype_CallStatus;
void skype_CallStatus(Call pCall, TCallStatus Status)
{
switch (Status)
{
case TCallStatus.clsRinging:
pCall.Answer();
string fileName = string.Format("{1}{0}.wav", DateTime.Now.Ticks, pCall.PartnerHandle);
string filePath = string.Format("C:\\skyperecoding\\{0}", fileName );
pCall.OutputDevice[TCallIoDeviceType.callIoDeviceTypeFile] = filePath;
if (voiceRecoding.ContainsKey(pCall.Id))
{
voiceRecoding.Remove(pCall.Id);
}
voiceRecoding.Add(pCall.Id, fileName);
skype.SendMessage(pCall.PartnerHandle, "Start Recording....");
break;
case TCallStatus.clsFinished:
skype.SendMessage(pCall.PartnerHandle, "Ending recording...");
voiceRecoding.Remove(pCall.Id);
break;
}
}
原文地址:http://blog.csdn.net/sunzongbao2007/article/details/45028015