Ejemplo n.º 1
0
 public virtual void PlayPauseStop()
 {
     _jackOut.Play();
     Assert.AreEqual(PlaybackState.Playing, _jackOut.PlaybackState);
     _jackOut.Pause();
     Assert.AreEqual(PlaybackState.Paused, _jackOut.PlaybackState);
     _jackOut.Play();
     Assert.AreEqual(PlaybackState.Playing, _jackOut.PlaybackState);
     _jackOut.Stop();
     Assert.AreEqual(PlaybackState.Stopped, _jackOut.PlaybackState);
 }
Ejemplo n.º 2
0
        private static void OnFinishFrame()
        {
            InputFinishFrame();

            ImmediateFrameTime = CurrentFrameTime = GetTime() - LastFrameTime;
            DeadTime           = FramePeriod - CurrentFrameTime;
            // Sound
            if (SoundEnabled)
            {
                if (!AudioOut.IsPlaying)
                {
                    AudioOut.Play();
                }

                // Blip buffer
                //audio_playback_blipbuffer.EndFrame(audio_playback_blipbuffer_timer);
                audio_playback_blipbuffer.EndFrame((uint)audio_playback_blipbuffer_timer);
                audio_playback_blipbuffer_timer = 0;

                // Submit call
                // byte[] returnBuffer = new byte[audio_playback_blipbuffer.SamplesAvailable() * 2];

                // audio_playback_blipbuffer.ReadSamples(returnBuffer, 0, audio_playback_blipbuffer.SamplesAvailable());
                short[] returnBuffer = new short[audio_playback_blipbuffer.SamplesAvailable()];
                audio_playback_blipbuffer.ReadSamples(returnBuffer, audio_playback_blipbuffer.SamplesAvailable(), false);
                AudioOut.Update(ref returnBuffer);
            }
            // Speed
            if (SpeedLimitterON)
            {
                while (ImmediateFrameTime < FramePeriod)
                {
                    ImmediateFrameTime = GetTime() - LastFrameTime;
                }
            }
            LastFrameTime = GetTime();
            // FPS
            FPSDone++;
            // Reset
            if (FPSDone > 1000)
            {
                FPSDone = 0;
            }
            if (request_pauseAtFrameFinish)
            {
                request_pauseAtFrameFinish = false;
                EmulationPaused            = true;
            }
        }
Ejemplo n.º 3
0
 public virtual void AudioFormat()
 {
     _jackOut.Play();
     Assert.AreEqual(_jackOut.OutputWaveFormat.SampleRate, _client.SampleRate);
     Assert.AreEqual(_jackOut.OutputWaveFormat.Channels, _client.AudioOutPorts.Count());
 }