public virtual void TestShouldIgnoreIncompleteMpegFrame() { Mp3File mp3File = new Mp3File(MP3_WITH_INCOMPLETE_MPEG_FRAME, 256); Assert.AreEqual(unchecked((int)(0x44B)), mp3File.GetXingOffset()); Assert.AreEqual(unchecked((int)(0x5EC)), mp3File.GetStartOffset()); Assert.AreEqual(unchecked((int)(0xF17)), mp3File.GetEndOffset()); Assert.IsTrue(mp3File.HasId3v1Tag()); Assert.IsTrue(mp3File.HasId3v2Tag()); Assert.AreEqual(5, mp3File.GetFrameCount()); }
private Mp3File LoadAndCheckTestMp3(string filename, int bufferLength) { Mp3File mp3File = new Mp3File(filename, bufferLength); Assert.IsTrue(mp3File.HasXingFrame()); Assert.AreEqual(6, mp3File.GetFrameCount()); Assert.AreEqual(MpegFrame.MPEG_VERSION_1_0, mp3File.GetVersion()); Assert.AreEqual(MpegFrame.MPEG_LAYER_3, mp3File.GetLayer()); Assert.AreEqual(44100, mp3File.GetSampleRate()); Assert.AreEqual(MpegFrame.CHANNEL_MODE_JOINT_STEREO, mp3File.GetChannelMode()); Assert.AreEqual(MpegFrame.EMPHASIS_NONE, mp3File.GetEmphasis()); Assert.IsTrue(mp3File.IsOriginal()); Assert.IsFalse(mp3File.IsCopyright()); Assert.AreEqual(128, mp3File.GetXingBitrate()); Assert.AreEqual(125, mp3File.GetBitrate()); Assert.AreEqual(1, ((MutableInteger)mp3File.GetBitrates()[224]).GetValue()); Assert.AreEqual(1, ((MutableInteger)mp3File.GetBitrates()[112]).GetValue()); Assert.AreEqual(2, ((MutableInteger)mp3File.GetBitrates()[96]).GetValue()); Assert.AreEqual(1, ((MutableInteger)mp3File.GetBitrates()[192]).GetValue()); Assert.AreEqual(1, ((MutableInteger)mp3File.GetBitrates()[32]).GetValue()); Assert.AreEqual(156, mp3File.GetLengthInMilliseconds()); return mp3File; }