Example #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);
        }
Example #2
0
        public List <MyWaveFormat> GetWaveFormats()
        {
            List <MyWaveFormat> output = new List <MyWaveFormat>();

            foreach (var wave in m_waves)
            {
                MyWaveFormat myWaveFormat = new MyWaveFormat()
                {
                    Encoding   = wave.Value.WaveFormat.Encoding,
                    Channels   = wave.Value.WaveFormat.Channels,
                    SampleRate = wave.Value.WaveFormat.SampleRate,
                    WaveFormat = wave.Value.WaveFormat
                };
                if (!output.Contains(myWaveFormat))
                {
                    output.Add(myWaveFormat);
                }
                else
                {
                }
            }
            return(output);
        }