예제 #1
0
        public XnaAudioDriver()
        {
            _audioFormat = new AudioFormat(44100);

            _buffer = new byte[13230 * 2];
            _dsei = new DynamicSoundEffectInstance(_audioFormat.SampleRate, _audioFormat.Channels == 2 ? AudioChannels.Stereo : AudioChannels.Mono);
            _dsei.BufferNeeded += OnBufferNeeded;
        }
예제 #2
0
파일: Mixer.cs 프로젝트: scemino/nscumm
 public Mixer(int sampleRate)
 {
     Debug.Assert(sampleRate > 0);
     _channels = new Channel[NumChannels];
     soundTypeSettings = new SoundTypeSettings[4];
     for (var i = 0; i < soundTypeSettings.Length; i++)
     {
         soundTypeSettings[i] = new SoundTypeSettings(MaxMixerVolume);
     }
     OutputRate = sampleRate;
     AudioFormat = new AudioFormat(OutputRate);
 }
예제 #3
0
 private static WaveFormat ToWaveFormat(AudioFormat format)
 {
     return new WaveFormat(format.SampleRate, format.Channels);
 }