Ejemplo n.º 1
0
 public void EnableMicrophone(ISoundDevice device = null)
 {
     if (Connection.CaptureDevice != null)
     {
         Connection.CloseCaptureDevice();
     }
     Connection.OpenCapture(device);
 }
Ejemplo n.º 2
0
 public void EnableSpeakers(ISoundDevice device = null)
 {
     if (Connection.PlaybackDevice != null)
     {
         Connection.ClosePlaybackDevice();
     }
     Connection.OpenPlayback(device);
 }
Ejemplo n.º 3
0
        internal CSoundTimer(ISoundDevice device)
        {
            this.Device = device;

            if (this.Device.eOutputDevice != ESoundDeviceType.OpenAL)
            {
                TimerCallback timerDelegate = new TimerCallback(SnapTimers);    // CSoundTimerをシステム時刻に変換するために、
                timer         = new Timer(timerDelegate, null, 0, 1000);        // CSoundTimerとCTimerを両方とも走らせておき、
                ctDInputTimer = new CTimer();                                   // 1秒に1回時差を測定するようにしておく
            }
            else                                                                // TESTCODE OpenAL時のみ、CSoundTimerでなくCTimerを使う
            {
                ct = new CTimer();
            }
        }
Ejemplo n.º 4
0
        internal CSoundTimer(ISoundDevice device)
        {
            this.Device = device;

            if (this.Device.e出力デバイス != ESoundDeviceType.DirectSound)
            {
                TimerCallback timerDelegate = new TimerCallback(SnapTimers);                    // CSoundTimerをシステム時刻に変換するために、
                timer         = new Timer(timerDelegate, null, 0, 1000);                        // CSoundTimerとCTimerを両方とも走らせておき、
                ctDInputTimer = new CTimer(CTimer.E種別.MultiMedia);                              // 1秒に1回時差を測定するようにしておく
            }
            else                                                                                // TESTCODE DirectSound時のみ、CSoundTimerでなくCTimerを使う
            {
                ct = new CTimer(CTimer.E種別.MultiMedia);
            }
        }
        public void MachLaut(int value, ISoundDevice soundDevice)
        {
            if (value < 50)
            {
                throw new ArgumentException("Wenig als 50 Hz geht nicht");
            }

            if (value > 2000)
            {
                throw new ArgumentException("Mehr als 2000 Hz geht nicht");
            }

            soundDevice.MakeBeep(value, 700);
            soundDevice.MakeBeep(value, 700);

            //Console.Beep(value, 700);
            //Console.Beep(value, 700);
        }
 /// <summary>
 /// Signs that the device has been attached to the Spectrum virtual machine
 /// </summary>
 public override void OnAttachedToVm(ISpectrumVm hostVm)
 {
     base.OnAttachedToVm(hostVm);
     _soundDevice = hostVm.SoundDevice;
 }