Exemplo n.º 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;
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 private static WaveFormat ToWaveFormat(AudioFormat format)
 {
     return new WaveFormat(format.SampleRate, format.Channels);
 }