Пример #1
0
        public static string GetFormatString(this IAudioTitle title)
        {
            switch (title.PCM.ChannelCount)
            {
            case 1: return("mono");

            case 2: return("stereo");

            default: return("multi-channel");
            }
        }
Пример #2
0
        public static string GetRateString(this IAudioTitle title)
        {
            var sr = title.PCM.SampleRate;

            if (sr % 1000 == 0)
            {
                return($"{sr / 1000}KHz");
            }
            if (sr % 100 == 0)
            {
                return($"{sr / 100}.{(sr / 100) % 10}KHz");
            }
            return($"{sr}Hz");
        }
Пример #3
0
        public static TimeSpan GetDuration(this IAudioTitle title)
        {
            var chapters = title.Chapters;

            return(chapters[chapters.Count - 1]);
        }