예제 #1
0
        public SDLAudio()
        {
            this.on = Settings.Audio_PlaybackEnabled;
            if (on)
            {
                try {
                    Mixer.Initialize();
                    // TODO: find another way to adjust volume
                    this.Volume = Settings.Audio_PlaybackVolume;

                    callback     = new AudioCallback(Signed16BigCallback);
                    audio_stream = new AudioStream(Settings.Audio_PlaybackFrequency,
                                                   AudioFormat.Signed16Big,
                                                   SoundChannel.Mono, 2205, callback, "My Nes Sound");

                    samples_buffer = new short[samples_count];

                    Mixer.OpenAudio(audio_stream);

                    audio_stream.Paused = true;
                    r_pos = w_pos = 0;
                } catch (Exception ex) {
                    Console.WriteLine(ex.ToString());
                }
            }
            recorder = new WaveRecorder();
        }
예제 #2
0
		public SDLAudio ()
		{
			this.on = Settings.Audio_PlaybackEnabled;
			if (on) {
				try {
					Mixer.Initialize ();
					// TODO: find another way to adjust volume
					this.Volume = Settings.Audio_PlaybackVolume;

					callback = new AudioCallback (Signed16BigCallback);
					audio_stream = new AudioStream (Settings.Audio_PlaybackFrequency,
					                                AudioFormat.Signed16Big,
					                                SoundChannel.Mono, 2205, callback, "My Nes Sound");

					samples_buffer = new short[samples_count];

					Mixer.OpenAudio (audio_stream);
                   
					audio_stream.Paused = true;
					r_pos = w_pos = 0;
                    
				} catch (Exception ex) {
					Console.WriteLine (ex.ToString ());
				}
			}
			recorder = new WaveRecorder ();
		}