当前位置: 首页>>代码示例>>C#>>正文


C# Call.set_OutputDevice方法代码示例

本文整理汇总了C#中Call.set_OutputDevice方法的典型用法代码示例。如果您正苦于以下问题:C# Call.set_OutputDevice方法的具体用法?C# Call.set_OutputDevice怎么用?C# Call.set_OutputDevice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Call的用法示例。


在下文中一共展示了Call.set_OutputDevice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangeCallStatus

        private void ChangeCallStatus(Call call, TCallStatus status)
        {
            try
            {
                //call is now calling
                string storefilelocation = "";
                Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                if (config.AppSettings.Settings["localVoiceRecordsPath"].Value != null && config.AppSettings.Settings["localVoiceRecordsPath"].Value!="")
                {
                    if (!Directory.Exists(config.AppSettings.Settings["localVoiceRecordsPath"].Value.Replace(",", "")))
                    {
                        Directory.CreateDirectory(config.AppSettings.Settings["localVoiceRecordsPath"].Value.Replace(",", ""));
                    }
                    storefilelocation = config.AppSettings.Settings["localVoiceRecordsPath"].Value.Replace(",", "") + "\\";
                }
                else
                {
                    MessageBox.Show("Local sound file location does not exist");
                    return;
                }

                lblCallStatus.Visible = true;
                if (status == TCallStatus.clsRinging)
                {
                    //this person calling -> call.PartnerDisplayName;
                    lblCallStatus.Text = "now calling";
                }

                //press disallow
                else if (status == TCallStatus.clsRefused)
                {
                    lblCallStatus.Text = "Refuse";
                }

                //press stop
                else if (status == TCallStatus.clsCancelled)
                {
                    lblCallStatus.Text = "Cancell";
                }

                //talk is now progress
                else if (status == TCallStatus.clsInProgress)
                {
                    picSound.Visible = true;
                    lblCallStatus.Text = "Call progress";
                    //record voice
                    //call.set_OutputDevice(TCallIoDeviceType.callIoDeviceTypeFile, storefilelocation + "in.wav");
                    //call.set_CaptureMicDevice(TCallIoDeviceType.callIoDeviceTypeFile, storefilelocation + "capture.wav");

                    call.set_OutputDevice(TCallIoDeviceType.callIoDeviceTypeFile, storefilelocation + "in.wav");
                    call.set_CaptureMicDevice(TCallIoDeviceType.callIoDeviceTypeFile, storefilelocation + "capture.wav");

                }

                //call is finish (now can wav convert to mp3)
                else if (status == TCallStatus.clsFinished)
                {
                    lblCallStatus.Visible = picSound.Visible = false;
                    lblCallStatus.Text = "Call end";
                    MergeFiles();
                    if (skype != null)
                    {
                        Marshal.ReleaseComObject(skype);
                    }
                    skype = null;
                    btnCall.Enabled = true;

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
            finally
            {
            }
        }
开发者ID:tridipkolkata,项目名称:SampleRepo,代码行数:77,代码来源:frmCallAssistant.cs

示例2: CallStatus

        private void CallStatus(Call call, TCallStatus status)
        {
            System.Console.WriteLine("Call Status:" + converter.CallStatusToText(status));
            System.Console.WriteLine("Call: " + converter.CallTypeToText(call.Type));
            if (status == TCallStatus.clsRinging && (call.Type == TCallType.cltIncomingPSTN || call.Type == TCallType.cltIncomingP2P))
            {
                System.Console.WriteLine("Incomming Call");
            }
            if ((status == TCallStatus.clsBusy || status == TCallStatus.clsCancelled || status == TCallStatus.clsFailed || status == TCallStatus.clsFinished))
            {
                System.Console.WriteLine("Ending Call");
                try
                {
                    Command hook = new Command();
                    hook.Command = "hook on";
                    oSkype.SendCommand(hook);
                    hook.Command = "hook off";
                    oSkype.SendCommand(hook);
                    radioButton2.Checked = false;
                }
                catch
                { }

                Console.WriteLine("Active Calls: " + oSkype.ActiveCalls.Count.ToString());

                if (oSkype.ActiveCalls.Count == 0)
                {
                    Console.WriteLine("Sending Email...");
                    sendmail();
                    Progress = false;
                    Console.WriteLine("Email Sent");
                    CheckMail.Enabled = true;
                }
            }
            if ((status == TCallStatus.clsInProgress))
            {
                if (Progress == false)
                {
                    Progress = true;
                    inProgress();
                }
                System.Console.WriteLine("In Progress - muting");
                ((ISkype)oSkype).Mute = true;
                Console.WriteLine("Recording");
                radioButton2.Checked = true;
                call.set_OutputDevice(TCallIoDeviceType.callIoDeviceTypeFile, "C:/Users/Robert/skype/" + call.Id.ToString() + ".wav");
                recordings.Add("C:/Users/Robert/skype/" + call.Id.ToString() + ".wav");
            }
        }
开发者ID:withinboredom,项目名称:callmeback,代码行数:49,代码来源:console.cs

示例3: OnSkypeCallStatus

        void OnSkypeCallStatus(Call call, TCallStatus status)
        {
            log.Info("SkypeCallStatus: {0}", status);
            if (status == TCallStatus.clsInProgress)
            {
                this.call = call;
                call.set_CaptureMicDevice(TCallIoDeviceType.callIoDeviceTypePort, MicPort.ToString());
                call.set_InputDevice(TCallIoDeviceType.callIoDeviceTypeSoundcard, "");

                call.set_OutputDevice(TCallIoDeviceType.callIoDeviceTypeFile, SkypeFx.Properties.Settings.Default["LogPath"]+"\\" + Util.MakeValidFileName(call.PartnerDisplayName + "_" + System.DateTime.Now.ToString("yyMMdd-HHmmss.wav")));
                call.set_InputDevice(TCallIoDeviceType.callIoDeviceTypePort, OutPort.ToString());
            }
            else if (status == TCallStatus.clsFinished)
            {
                call = null;
                lock (outStreamLock)
                {
                    outStream.Dispose();
                }
                micStream.Dispose();
            }
        }
开发者ID:Jiyuu,项目名称:SkypeFX,代码行数:22,代码来源:SkypeConnector.cs


注:本文中的Call.set_OutputDevice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。