If you would like to discuss anything, please contact me via email: Howard.Bayliss@sequence.co.uk

Wednesday, June 27, 2012

SharePoint Index Music

I'm storing music tracks in a SharePoint Foundation 2010 library. I want users to be able to search for tracks using music file metadata e.g. Track Name. Artist, Album, Lyrics, etc.

This metadata is stored within popular music file types (e.g. mp3, wma, ogg, etc); though the format of the metadata varies. So how can SharePoint index these files and extract the metadata? You have a number of options:

  1. Install FAST Search Server 2010 and the "Advanced Filter Pack", which can index certain music file types.
  2. Install a 3rd party IFilter, which knows how to index your music files. You'll probably need one IFilter for each specific media file type.
  3. Develop your own music file IFilter. This should be written in C++ and it's not an easy exercise - believe me; I've tried.
  4. Expose the music file metadata through the standard SharePoint user interface.

I went for option (4), but it does require some development knowledge, and the use of a 3rd party .Net library called "taglib-sharp". In essence you create a SharePoint Event Receiver that fires whenever a music file is added to a library. The Receiver then uses "taglib-sharp" to extract metadata from the file and copy it to custom SharePoint metadata.

The picture below shows the custom SharePoint metadata, extracted from an .mp3 file:

The SharePoint indexer can now index the custom metadata, which you can then use in custom searches.

Two great things about taglib-sharp:

  1. It can be called from .Net and is easy to use - you just point it directly at a file in the SharePoint library.
  2. It supports the following music file formats: wma, aiff, asf, mp3, m4a, mpeg, ogg, riff, aac, ape, flac, Musepack and WavPack.

No comments:

Post a Comment