Exemplo n.º 1
0
        private void Stop()
        {
            //Recorder
            if (m_Recorder != null)
            {
                try
                {
                    m_Recorder.Dispose();
                }
                finally
                {
                    m_Recorder = null;
                }
            }

            //Writer\
            if (m_Writer != null)
            {
                m_Writer.Flush();
                m_Writer.Close();
                m_Writer = null;
            }
        }
Exemplo n.º 2
0
        private void Start(string FileName)
        {
            Stop();
            try
            {
                //Start WaveIn recorder
                m_Recorder =
                    new WaveLib.WaveInRecorder
                        (Globals.GetInstance().DefaultWaveInDevice, //previously : -1
                        m_Format,
                        bufferSize,
                        3,
                        new WaveLib.BufferDoneEventHandler(DataArrived));

                //Start capturing the music to a WAV stream
                Stream WaveFile =
                    new FileStream(FileName,
                                   FileMode.Create,
                                   FileAccess.Write);
                m_Writer =
                    new WaveWriter(WaveFile, m_Format);

            }
            catch(Exception _e)
            {
                Stop();

                //Handle it
                if (Globals.GetInstance().SuppressError == false)
                {
                    frmException frm = new frmException();
                    frm.ExceptionDialogTitle = "Raaga.com navigational problem ";
                    frm.ErrorMessage = _e.Message;
                    frm.StrackTrace = _e.StackTrace;
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        frm.Dispose();
                        frm = null;
                    }
                }

            }
        }