Example #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////      METHOD      ///////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////

        public void Play()
        {
            SetPosition(0);

            timer.Start();
            output.Play();
            UpdatePlaying();
            OnPlayingStarted();
        }
Example #2
0
        public override void Init()
        {
            NAudio.CoreAudioApi.MMDeviceEnumerator a = new NAudio.CoreAudioApi.MMDeviceEnumerator();
            var dev = a.GetDefaultAudioEndpoint(NAudio.CoreAudioApi.DataFlow.Render, NAudio.CoreAudioApi.Role.Multimedia);
            o = new WasapiOut(dev,NAudio.CoreAudioApi.AudioClientShareMode.Shared,false, 50);

            //o = new WaveOut();
            bwp = new BufferedWaveProvider(WaveFormat.CreateIeeeFloatWaveFormat(16000, 1));
            bwp.BufferDuration = TimeSpan.FromMilliseconds(2000);
            bwp.DiscardOnBufferOverflow = true;
            o.Init(bwp);
            o.Play();
            //delaypos = 0;
        }
Example #3
0
        public override void Init()
        {
            NAudio.CoreAudioApi.MMDeviceEnumerator a = new NAudio.CoreAudioApi.MMDeviceEnumerator();
            var dev = a.GetDefaultAudioEndpoint(NAudio.CoreAudioApi.DataFlow.Render, NAudio.CoreAudioApi.Role.Multimedia);

            o = new WasapiOut(dev, NAudio.CoreAudioApi.AudioClientShareMode.Shared, false, 50);

            //o = new WaveOut();
            bwp = new BufferedWaveProvider(WaveFormat.CreateIeeeFloatWaveFormat(16000, 1));
            bwp.BufferDuration          = TimeSpan.FromMilliseconds(2000);
            bwp.DiscardOnBufferOverflow = true;
            o.Init(bwp);
            o.Play();
            //delaypos = 0;
        }