using System.IO; // ReSharper disable once CheckNamespace namespace NAudio.Wave { /// /// Class for reading from MP3 files /// public class Mp3FileReader : Mp3FileReaderBase { /// Supports opening a MP3 file public Mp3FileReader(string mp3FileName) : base(File.OpenRead(mp3FileName), CreateAcmFrameDecompressor, true) { } /// /// Opens MP3 from a stream rather than a file /// Will not dispose of this stream itself /// /// The incoming stream containing MP3 data public Mp3FileReader(Stream inputStream) : base(inputStream, CreateAcmFrameDecompressor, false) { } /// /// Creates an ACM MP3 Frame decompressor. This is the default with NAudio /// /// A WaveFormat object based /// public static IMp3FrameDecompressor CreateAcmFrameDecompressor(WaveFormat mp3Format) { // new DmoMp3FrameDecompressor(this.Mp3WaveFormat); return new AcmMp3FrameDecompressor(mp3Format); } } }