Cuando vimos Gestión de Archivos en Python, desarrollamos un ejemplo que leia el ID3 Tag de un MP3. En esta ocasión, vamos a hacer lo mismo, pero utilizando C#.

El código:

OpenFileDialog fileDialogAbrir = new OpenFileDialog();
fileDialogAbrir.Filter = "Archivos MP3 (*.mp3)|*.mp3";
fileDialogAbrir.ShowDialog();

String fileMP3 = textMP3.Text = fileDialogAbrir.FileName;

//Lectura de ID3 Tag v1 y v1.1
if (fileMP3.Length> 0)
{
    FileStream fs;
    fs = new FileStream( fileMP3 , FileMode.Open);
    byte[] buffer = new byte[128];
    fs.Seek(-128, SeekOrigin.End);
    fs.Read(buffer,0, 128);
    fs.Close();

    Encoding  enc = new ASCIIEncoding();
    string id3 = enc.GetString(buffer);

    if ( id3.Substring(0,3).Equals("TAG") ) {
        textTitulo.Text     = id3.Substring( 3, 30).TrimEnd();
        textArtista.Text    = id3.Substring(33, 30).TrimEnd();
        textAlbum.Text      = id3.Substring(63, 30).TrimEnd();
        textAño.Text        = id3.Substring(934).TrimEnd();
        textComentario.Text = id3.Substring(97, 28).TrimEnd();

        if (id3[125] == 0) {
            textNumero.Text = Convert.ToString(buffer[126]);
        }

        comboGenero.SelectedIndex = Convert.ToInt16(buffer[127]);
    }
    else
    {
        MessageBox.Show("IDE3 Tag no disponible", "LuAuF", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
}


El proyecto para descargar.