录制时设定时间 [英] Setting time when Recording

查看:97
本文介绍了录制时设定时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个音频编辑器,我的录音正在工作,但是无法启动计时器并在录音打开时停止计时器.到目前为止我知道了

I am doing an Audio editor, my recording is working but im not being able to start the timer and stop it when the recording is on. I got this so far

private void Record()
       {
           mciSendString("Open new type waveaudio alias Sound", null, 0, 0);
           mciSendString("Record Sound", null, 0, 0)
           this.Rectimer.Enabled = true;
           Status_Label.Text = "Recording.....";
       }







private void StopRecording()
     {
         mciSendString("pause Sound", null, 0, 0);
         this.Rectimer.Enabled = false;
         Status_Label.Text = "Stop Recording.....";
     }



即时通讯使用了一个组件,即RecTimer



im using one components which is the RecTimer

private void Rectimer_Tick(object sender, EventArgs e)
        {
            int TimeRec = (MicRec.IsRecording);
            this.lbl_timeControl.Text = string.Format("{0}", DisplayTime(Sp.PositionInMS));
        }
        private string DisplayTime(int ch)
        {
            DateTime ry = new DateTime((long) 1000);
            return ry.ToString("T");
        }




我的错误是什么导致我无法在录制开始时启动计时器?
预先感谢伙计们




What is my error there that is no enabling me to start the timer when the recording starts?
Thanks in advance guys

推荐答案

您设置了计时器间隔吗?
在您的代码中看不到.

RecTimer.Interval是要设置的属性.
它的单位以毫秒为单位,所以一秒钟您会
请执行以下操作(例如在InitializeComponent()中)

Rectimer.Interval = 1000; //1000毫秒==一秒

希望这一点更清楚. ;)
干杯

曼弗雷德(Manfred)
Have you set the timer interval?
Can''t see that in your code.

RecTimer.Interval is the property you want to set.
Its unit is in milli seconds so for one second you''d
do the following (e.g. in InitializeComponent())

Rectimer.Interval = 1000; //1000 milli seconds == one second

Hope this is a little bit clearer. ;)
Cheers

Manfred


这篇关于录制时设定时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆