public static string StartRecording(string hwCTime, string stuHwId, string tqId) { try { hwCTime = hwCTime.Filter(); stuHwId = stuHwId.Filter(); tqId = tqId.Filter(); string wavfile = null; string basicFolder = HttpContext.Current.Server.MapPath("/Upload/Resource/teacherRecording/"); string filePath = string.Format("{0}/{1}/{2}/", basicFolder, hwCTime, stuHwId); if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } filePath += string.Format("{0}.wav", tqId); wavfile = filePath; recorder.SetFileName(wavfile); recorder.RecStart(); return("0"); } catch (Exception) { return("1"); } }
public static string StartRecording() { try { string wavfile = null; wavfile = HttpContext.Current.Server.MapPath("/Upload/Resource/teacherRecording/1.wav"); recorder.SetFileName(wavfile); recorder.RecStart(); return("0"); } catch (Exception) { return("1"); } }