Mp3 Tag Islemleri

Mp3 Tag Islemleri

Mp3 dosyasinin taglarini okumak icin oncelikle TagLib.DLL dosyasini indirmeniz gerekiyor. Referanslara ekledikten sonra asagidaki sekilde taglara ulasabilirsiniz;

private void button1_Click(object sender, EventArgs e)
{
foreach (Control c in this.Controls)
{
if (c is Label)
{
c.Text = string.Empty;
}
}
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
try
{
string yol = openFileDialog1.FileName;
TagLib.File mp3 = TagLib.File.Create(yol);

lblDosya.Text = "Dosya Adi : " + openFileDialog1.SafeFileName;
lblSanatci.Text = "Sanatci Adi : " + GetAllStringsFromArrary(mp3.Tag.AlbumArtists, ",");
lblAlbum.Text = "Album Adi : " + mp3.Tag.Album;
lblUzunluk.Text = "Uzunluk : " + mp3.Properties.Duration.ToString();
lblBaslik.Text = "Baslik : " + mp3.Tag.Title;
lblTrack.Text = "Track : " + mp3.Tag.Track.ToString();
lblYil.Text = "Yil : "+ mp3.Tag.Year.ToString();
lblBesteciler.Text = "Besteciler : "+ GetAllStringsFromArrary(mp3.Tag.Composers, ",");
lblTur.Text = "Tur : "+ GetAllStringsFromArrary(mp3.Tag.Genres, ",");
}
catch (Exception ex)
{
MessageBox.Show("Hata olustu!");
throw;
}

}
}

public string GetAllStringsFromArrary(string[] strArray, string strDelimeter)
{
string strFinal = string.Empty;

for (int i = 0; i < strArray.Length; i++) { strFinal += strArray[i]; if (i != strArray.Length - 1) { strFinal += strDelimeter; } } return strFinal; }

Ayni sekilde yeni degerler de atayabilirsiniz;


mp3.Tag.Album = "AlbumAdi";
mp3.Tag.Year = 2013;

Ayrica diger taglari da TagLib ile bulabilirsiniz;

MessageBox.Show("Bit Rate : " + mp3.Properties.AudioBitrate.ToString());

Ornek uygulamayi buradan indirebilirsiniz, TagLib.Dll dosyasini da ayrica buradan indirebilirsiniz.

Yayınlanan <a href="https://www.mahmuttalhakoz.com/blog/index.php/category/csharp/" rel="category tag">C#</a> Takip edilen <a href="https://www.mahmuttalhakoz.com/blog/index.php/tag/c/" rel="tag">c#</a>, <a href="https://www.mahmuttalhakoz.com/blog/index.php/tag/c-mp3/" rel="tag">c# mp3</a>, <a href="https://www.mahmuttalhakoz.com/blog/index.php/tag/c-mp3-islemleri/" rel="tag">c# mp3 islemleri</a>, <a href="https://www.mahmuttalhakoz.com/blog/index.php/tag/c-mp3-kac-bit/" rel="tag">c# mp3 kac bit</a>, <a href="https://www.mahmuttalhakoz.com/blog/index.php/tag/c-mp3-tag-islemleri/" rel="tag">c# mp3 tag islemleri</a>, <a href="https://www.mahmuttalhakoz.com/blog/index.php/tag/mp3-functions/" rel="tag">mp3 functions</a>, <a href="https://www.mahmuttalhakoz.com/blog/index.php/tag/mp3-tag-functions/" rel="tag">mp3 tag functions</a>, <a href="https://www.mahmuttalhakoz.com/blog/index.php/tag/mp3-tag-islemleri/" rel="tag">mp3 tag islemleri</a> Bir yorum yapın