这就是我想要做的
private KinectAudioSource CreateAudioSource()
{
var source = KinectSensor.KinectSensors[0].AudioSource;
source.NoiseSuppression = _isNoiseSuppressionOn;
source.AutomaticGainControlEnabled = _isAutomaticGainOn;
return source;
}
private object lockObj = new object();
private void RecordKinectAudio()
{
lock (lockObj)
{
using (var source = CreateAudioSource())
{
}
}
}
Run Code Online (Sandbox Code Playgroud)
'using'语句给出了一个错误,指出 - "'Microsoft.Kinect.KinectAudioSource':在using语句中使用的类型必须可以隐式转换为'System.IDisposable'".如何消除此错误,这是什么意思?