public static void ParseStream(Stream stream) { AudioTags audioTags = new AudioTags(); audioTags.AudioTagParse += AudioTagParse; try { audioTags.ReadTags(stream); } catch (Exception ex) { Console.WriteLine("[-] Exception thrown: {0}", ex); return; } foreach (IAudioTagOffset tagOffset in audioTags.Where(t => t.AudioTag is Id3v2Tag)) { Id3v2Tag tag = tagOffset.AudioTag as Id3v2Tag; if (tag == null) continue; Id3v2ExperimentalTestFrame testFrame = tag.GetFrame<Id3v2ExperimentalTestFrame>(); if (testFrame == null) { testFrame = new Id3v2ExperimentalTestFrame(tag.Version) { TextEncodingType = Id3v2FrameEncodingType.UTF16BigEndian, TaggingLibraryUsed = "This one", TaggingLibraryAuthor = "Me", TaggingLibraryWebsite = "http://www.google.com/", TaggingLibrarySupportsFrame = true, DateOfTag = DateTime.MaxValue }; tag.SetFrame(testFrame); } } }
/// <summary> /// Equals the specified <see cref="Id3v2ExperimentalTestFrame"/>. /// </summary> /// <param name="testFrame">The <see cref="Id3v2ExperimentalTestFrame"/>.</param> /// <returns>true if equal; false otherwise.</returns> public bool Equals(Id3v2ExperimentalTestFrame testFrame) { if (ReferenceEquals(null, testFrame)) return false; if (ReferenceEquals(this, testFrame)) return true; return (testFrame.Version == Version) && String.Equals(testFrame.TaggingLibraryUsed, TaggingLibraryUsed, StringComparison.OrdinalIgnoreCase) && String.Equals(testFrame.TaggingLibraryAuthor, TaggingLibraryAuthor, StringComparison.OrdinalIgnoreCase) && String.Equals(testFrame.TaggingLibraryWebsite, TaggingLibraryWebsite, StringComparison.OrdinalIgnoreCase) && testFrame.DateOfTag.Equals(DateOfTag) && (testFrame.TaggingLibrarySupportsFrame == TaggingLibrarySupportsFrame); }