示例#1
0
        private void SetupVoice(AudioFormat format)
        {
            WaveFormat wFmt = new WaveFormat(format.SampleRate, format.BitsPerSample, format.Channels);

            SourceVoice = _engine.Device.CreateSourceVoice(wFmt);

            if (_submixer != null)
            {
                var vsDesc = new VoiceSendDescriptor();
                vsDesc.OutputVoice = _submixer.SubMixerVoice;
                SourceVoice.SetOutputVoices(new VoiceSendDescriptor[] { vsDesc });
            }

            SourceVoice.SetVolume(_volume);
        }