Ejemplo n.º 1
0
 public AudioMetadata ReadMetadata(Stream stream)
 {
     try
     {
         // Check for an ID3v2 tag first
         var tagModel = TagManager.Deserialize(stream);
         return(new TagModelToMetadataAdapter(tagModel));
     }
     catch (TagNotFoundException)
     {
         try
         {
             // If no ID3v2 tag was found, check for ID3v1
             var v1Tag = new Id3V1();
             v1Tag.Deserialize(stream);
             return(new Id3V1ToMetadataAdapter(v1Tag));
         }
         catch (TagNotFoundException e)
         {
             throw new AudioUnsupportedException(e.Message);
         }
     }
 }