Example #1
0
        public Voice GetFreeVoice()
        {
            if (FreeVoices.Length > 0)
            {
                var voice = FreeVoices.First.Value;
                FreeVoices.RemoveFirst();
                return(voice);
            }

            return(StealQuietestVoice());
        }
Example #2
0
        public Voice GetFreeVoice()
        {
            if (FreeVoices.Length > 0)
            {
                var voice = FreeVoices.First.Value;
                FreeVoices.RemoveFirst();
                return(voice);
            }
            switch (StealingMethod)
            {
            case VoiceStealingMethod.Oldest:
                return(StealOldest());

            case VoiceStealingMethod.Quietest:
                return(StealQuietestVoice());

            default:
                return(null);
            }
        }