示例#1
0
 public void RecordStop()
 {
     stop = "is";
     wi.StopRecording();
     wi.Dispose();
     wi = null;
     writer.Close();
     writer.Dispose();
     writer = null;
     if (JsEvent.parameter != null && JsEvent.parameter.zimu != null && JsEvent.parameter.zimu != "")
     {
         ssound_stop(m_engine);
     }
 }
示例#2
0
 public void stopPinCe()
 {
     try
     {
         stop = "";
         wi.StopRecording();
         wi.Dispose();
         wi = null;
         writer.Close();
         writer.Dispose();
         writer = null;
         ssound_stop(m_engine);
     }
     catch (Exception ee)
     {
         new Helper().InsertErrorMsg("停止录音录音" + ee.StackTrace, ee.Message);
         throw;
     }
     LameWavToMp3(@"data\" + LuYinPath + ".wav", @"data\" + LuYinPath + ".mp3");//将wav转为mp3并上传到智慧校园文件服务器
 }
示例#3
0
 private void Start()
 {
     try
     {
         wi = new WaveInStream(0, new WaveFormat(16000, 16, 1), this);
         wi.DataAvailable += new EventHandler <WaveInEventArgs>(wi_DataAvailable);
         String data    = DateTime.Now.ToString();
         String newdata = data.Replace("/", "").Replace(":", "").Replace(" ", "");
         Directory.Delete("./data", true);
         Directory.CreateDirectory("./data");
         wavePath  = "./data/" + newdata + ".wav";
         LuYinPath = newdata;
         writer    = new WaveFileWriter(wavePath, wi.WaveFormat);
         wi.StartRecording();
     }
     catch (Exception ee)
     {
         new Helper().InsertErrorMsg(ee.Message, "初始化录音流异常");
         throw;
     }
 }