예제 #1
0
        public ISampleProvider Create(List <string> musicList, double musicBreak)
        {
            if (musicList == null)
            {
                throw new ArgumentNullException("Список треков пуст");
            }

            ISampleProvider readerMusic = new AudioFileReader(musicList.First());

            foreach (var music in musicList)
            {
                if (musicList.IndexOf(music) == 0)
                {
                    continue;
                }

                var reader = new AudioFileReader(music);
                readerMusic = readerMusic.FollowedBy(TimeSpan.FromSeconds(musicBreak), reader);
            }
            return(readerMusic);
        }