我有这个功能:
public WaveIn(WaveCallbackInfo callbackInfo)
{
this.DeviceNumber = 0;
this.WaveFormat = new WaveFormat(8000, 16, 1);
this.BufferMilliseconds = 100;
this.NumberOfBuffers = 3;
this.callback = new WaveInterop.WaveCallback(Callback);
this.callbackInfo = callbackInfo;
callbackInfo.Connect(this.callback);
}
我该怎么称呼它?
WaveIn(callbackInfo: ????);
我想改变这里的参数:
this.WaveFormat = new WaveFormat(8000, 16, 1);
如果我无法在回调中更改这些参数,我可以覆盖它吗?
谢谢
答案 0 :(得分:0)
我建议您忽略该构造函数并调用默认构造函数
var waveIn = new WaveIn();
如果要指定不同的录制WaveFormat,只需设置WaveFormat属性(开始录制之前)
waveIn.WaveFormat = new WaveFormat(44100, 16, 2);