c# 4.0 - without playing a audio file in C# how to find duration of that file -
without playing audio file in c# how find duration of file. kindly give code of that. write code play audio. not working. code mentioned below.....
protected void button1_click(object sender, eventargs e) { if (fileupload1.hasfile) { string filename = @"e:\ayush\adios.wav"; fileinfo f = new fileinfo(filename); long s1 = f.length; label2.text = s1.tostring(); soundplayer player = new soundplayer(filename); { player.loadasync(); player.playsync(); // player.stop(); } }
there no buildin support in .net framework metadata media files, can use taglibsharp metadata information video, image , audio files.
taglibsharp can installed using nuget manager in visual studio. see here.
Comments
Post a Comment