1
我正在嘗試將MWArray的byts傳遞給函數。字節數組從mp3文件中獲取數據。如何分配或傳遞字節數組到MWArray?
現在我想分配字節數組到MWArray。
我喜歡這個
string lSongFilePath = ConfigurationManager.AppSettings["SongFilePath"].ToString();
lSongFilePath += "\\" + "Grand Piano - Fazioli - major A.wav";
FileStream fs = File.OpenRead(lSongFilePath);
try
{
byte[] bytes = new byte[fs.Length];
var read = (fs.Read(bytes, 0, Convert.ToInt32(fs.Length)));
MWArray[] in_Arr = new MWArray[(int)read];
MWArray[] out_Arr = null;// = new MWArray[15];
ChordRecognizer hj = new ChordRecognizer();
hj.estimateTuning(4,ref out_Arr, in_Arr);
fs.Close();
}
catch(Exception ex)
{
string s = ex.Message;
}
這行代碼只是提數組的大小,同時我希望分配的數據陣列了。請幫助
MWArray[] in_Arr = new MWArray[(int)read];