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


C# ICall.ConnectAudioSender方法代码示例

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


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

示例1: MediaManager

        public MediaManager(ICall call)
        {
            mediaConnector = new MediaConnector();

            phoneCallAudioReceiver = new AudioMixerMediaHandler();
            phoneCallAudioSender = new AudioMixerMediaHandler();

            incomingAudioMixer = new AudioMixerMediaHandler();
            outgoingAudioMixer = new AudioMixerMediaHandler();

            call.ConnectAudioSender(outgoingAudioMixer);
            call.ConnectAudioReceiver(incomingAudioMixer);
            //mediaConnector.Connect(phoneCallAudioReceiver, incomingAudioMixer);
            //mediaConnector.Connect(outgoingAudioMixer, phoneCallAudioSender);

            //phoneCallAudioReceiver.AttachToCall(call);
            //phoneCallAudioSender.AttachToCall(call);
        }
开发者ID:flybird119,项目名称:ozeki-ivr-studio,代码行数:18,代码来源:MediaManager.cs

示例2: CallPressed

        private void CallPressed(string phoneNumber)
        {
            Logger.Log("Calling " + phoneNumber);

            WaveStreamPlayback waveStream = null;

            initiatedCall = apiExt.CreateCall(UsedPhoneNumber, phoneNumber, phoneNumber);
            if (initiatedCall == null)
                return;
            bool transferStarted = false;
            initiatedCall.CallStateChanged += (sender, e) =>
            {
                try
                {

                    if (e.Item == CallState.Answered)
                    {
                        if (transferStarted)
                        {
                            initiatedCall.DisconnectAudioSender(waveStream);
                            waveStream.Dispose();

                            var tts = new TextToSpeech();

                            tts.Stopped += (sender1, e1)=>{
                                                              tts.Dispose();
                                                              initiatedCall.HangUp();
                                                          };

                            initiatedCall.ConnectAudioSender(tts);
                            tts.AddAndStartText(string.Format("Calling {0} has failed. Please try again later.", phoneNumber));
                            return;
                        }

                        var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("OPSCallAssistant.Resources.ringback.wav");
                        waveStream = new WaveStreamPlayback(stream, true, true);

                        initiatedCall.ConnectAudioSender(waveStream);
                        waveStream.StartStreaming();

                        transferStarted = true;
                        initiatedCall.BlindTransfer(phoneNumber);

                    }
                    if (e.Item.IsCallEnded())
                    {
                        if (waveStream != null)
                            waveStream.Dispose();
                    }
                }
                catch(Exception ex)
                {
                    Logger.Log(ex.Message);
                    Logger.Log(ex.StackTrace);
                }

                var k = 65;

            };
            initiatedCall.Start();
        }
开发者ID:BertaAndras,项目名称:secret-sensa,代码行数:61,代码来源:MainViewModel.cs


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