示例#1
0
文件: ToxCall.cs 项目: TimBo93/Toxy
        public override void Start(int input, int output, ToxAvCodecSettings settings, string videoDevice = "")
        {
            WaveFormat outFormat       = new WaveFormat((int)settings.AudioSampleRate, 2);
            WaveFormat outFormatSingle = new WaveFormat((int)settings.AudioSampleRate, 1);

            filterAudio = new FilterAudio((int)settings.AudioSampleRate);
            filterAudio.EchoFilterEnabled = false;

            wave_provider = new BufferedWaveProvider(outFormat);
            wave_provider.DiscardOnBufferOverflow = true;
            wave_provider_single = new BufferedWaveProvider(outFormatSingle);
            wave_provider_single.DiscardOnBufferOverflow = true;

            if (WaveIn.DeviceCount > 0)
            {
                wave_source = new WaveInEvent();

                if (input != -1)
                {
                    wave_source.DeviceNumber = input;
                }

                WaveFormat inFormat = new WaveFormat((int)ToxAv.DefaultCodecSettings.AudioSampleRate, 1);

                wave_source.WaveFormat         = inFormat;
                wave_source.DataAvailable     += wave_source_DataAvailable;
                wave_source.RecordingStopped  += wave_source_RecordingStopped;
                wave_source.BufferMilliseconds = ToxAv.DefaultCodecSettings.AudioFrameDuration;
            }

            if (WaveOut.DeviceCount > 0)
            {
                wave_out = new WaveOut();

                if (output != -1)
                {
                    wave_out.DeviceNumber = output;
                }

                wave_out.Init(wave_provider);
                wave_out.Play();

                wave_out_single = new WaveOut();

                if (output != -1)
                {
                    wave_out.DeviceNumber = output;
                }

                wave_out.Init(wave_provider_single);
                wave_out.Play();
            }
        }
示例#2
0
 public void Call(int current_number, ToxAvCodecSettings settings, int ringing_seconds)
 {
     toxav.Call(current_number, settings, ringing_seconds, out CallIndex);
 }
示例#3
0
文件: ToxCall.cs 项目: TimBo93/Toxy
 /// <summary>
 /// Not implemented.
 /// </summary>
 public override void Call(int current_number, ToxAvCodecSettings settings, int ringing_seconds)
 {
     throw new NotImplementedException();
 }