Exemplo n.º 1
0
        internal MySourceVoice GetVoice(MyCueId cueId, MyInMemoryWave wave, CuePart part = CuePart.Start)
        {
            MyWaveFormat myWaveFormat = new MyWaveFormat()
            {
                Encoding   = wave.WaveFormat.Encoding,
                Channels   = wave.WaveFormat.Channels,
                SampleRate = wave.WaveFormat.SampleRate,
                WaveFormat = wave.WaveFormat
            };

            MySourceVoice voice = m_voicePools[myWaveFormat].NextAvailable();

            if (voice == null)
            {
                return(null);
            }
            voice.Flush();
            voice.SubmitSourceBuffer(cueId, wave, part);

            if (m_applyReverb)
            {
                voice.Voice.SetEffectChain(m_effectDescriptor);
                voice.Voice.EnableEffect(0);
            }
            else
            {
                voice.Voice.SetEffectChain(null);
            }
            return(voice);
        }