public Track(int id, string FileName) : this(id) { Mp3FileReader reader = new Mp3FileReader(FileName); this.reader = reader; //chk: int c = this.reader.WaveFormat.Channels; if (c != 1 && c != 2) { throw new Exception("unsupported channel count" + c); } StandardizBitsPerSample(); StandardizChannels(); StandardizSampleRate(); this.Info.Clear(); this.Info.Add("Name", Path.GetFileNameWithoutExtension(FileName)); this.Info.Add("Average bytes per second", reader.Mp3WaveFormat.AverageBytesPerSecond.ToString()); this.Info.Add("Bits per sample", reader.WaveFormat.BitsPerSample.ToString()); this.Info.Add("Channels", reader.WaveFormat.Channels.ToString()); this.Info.Add("Encoding", reader.Mp3WaveFormat.Encoding.ToString()); this.Info.Add("Sample rate", reader.WaveFormat.SampleRate.ToString()); UI.SetName(string.Format("TrackID {0} - {1}", id, Path.GetFileNameWithoutExtension(FileName)), false); UI.SetToolTib(Program.DictionaryToString(Info)); SetLength(); DrowWave(); //this.speedControl = new VarispeedSampleProvider(reader.ToSampleProvider(), 100, new SoundTouchProfile(true, false)); }
public Track(int id) { this.Info = new Dictionary <string, string>(); this.id = id; UI = new TrackUC(id); UI.SetName("Track " + id); //UI.track = this; }