timheuer / taglib-sharp-portable

.NET Portable Class Library implementation of TagLib# (forked from TagLib# main project)
Other
58 stars 33 forks source link

Check if id3 tags are readable (and not corrupted) #31

Closed zoriya closed 6 years ago

zoriya commented 6 years ago

Hello, i'm using your library on a music app project for xamarin android and i need to check a tag for all music file of the device but if the user have a corrupted file on the device, the app crash with this exception:

TagLib.CorruptFileException: MPEG audio header not found.

Could you create a way to check if the file is corrupted or just return null to all tag and not stop the app.

Thanks for your time and attention. Great library btw.

StefanFabian commented 6 years ago

Why don't you handle this case yourself? Just catch the exception and handle it as if the tag was null.

zoriya commented 6 years ago

Yeah sorry, i just found the exception class. Thanks for the quick reply.