C#获取WAVE文件文件头信息
前些日子在论坛里问了,没人回答,今天有空自己写了一下
文件格式依据网站
http://www.moon-soft.com/program/FORMAT/
using System;
using System.IO;
using System.Text;
namespace WAV
{
///
/// Summary description for Wav.
///
public class Wav
{
public Wav()
{
//
// TODO: Add constructor logic here
//
}
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
string strpath=@"C:Documents and SettingsAdministrator桌面 rojan怀念战友.wav";//=@"F:Music";
if(args.Length>0)
{
strpath=args[0].Trim();
}
if(File.Exists(strpath))
{
GetWavInfo(strpath);
Console.WriteLine("GetWavInfo Successfully!");
//Console.WriteLine("");
}
else
{
Console.Write("Please Enter the write filepath!
");
Console.Write("用法: WAV [Full Path Of Your WAV filepath]");
}
}
public struct WavInfo
{
public string groupid;
public string rifftype;