SKYPE4COM 录音

来源:互联网 发布:linux sleep命令 编辑:程序博客网 时间:2024/04/29 14:49

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;
            }
        }

1 0
原创粉丝点击