Recently I have been working on a voice recording software application. It is a WPF Windows application that has to run on computers running Windows XP and newer.

When I started the project I had to make a choice for the encoding between MP3 and Windows Media Audio. I ended up choosing Windows Media Audio because of licensing issues around the MP3 format.

After doing a bit of research I ended up using the NAudio library by Mark Heath which as far as I am concerned provides an excellent managed abstraction over the various audio technologies available in Windows for doing audio recording and playback

While working on this project, one of the aspects I found to be a little poorly documented was that of managing WMA meta tags (or attributes) while recording or playing back a WMA media file

The following is a quick summary of my findings. First a little bit about writing meta tag attributes when writing a WMA file

How to Write WMA Meta Tags

Using the NAudio WindowsMediaFormat library it is pretty straight-forward to add meta tags to an audio recording via the constructor of the WmaWriter class.

How to Read WMA Meta Tags

Reading meta tag attributes is even easier than writing them. It can be acomplished using the WmaStream class, also available in the NAudio WindowsMediaFormat library. The WmaStream provides a nice indexer that can be used to read meta tag attributes based on the attribute name.