public static string GetFormatString(this IAudioTitle title) { switch (title.PCM.ChannelCount) { case 1: return("mono"); case 2: return("stereo"); default: return("multi-channel"); } }
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"); }
public static TimeSpan GetDuration(this IAudioTitle title) { var chapters = title.Chapters; return(chapters[chapters.Count - 1]); }