How can I determine the length (i.e. duration) of a .wav file in C#?

后端 未结 15 2287
逝去的感伤
逝去的感伤 2020-11-30 00:26

In the uncompressed situation I know I need to read the wav header, pull out the number of channels, bits, and sample rate and work it out from there: (channels) * (bits) *

15条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 01:30

    In the .net framework there is a mediaplayer class:

    http://msdn.microsoft.com/en-us/library/system.windows.media.mediaplayer_members.aspx

    Here is an example:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2667714&SiteID=1&pageid=0#2685871

提交回复
热议问题