求帮助 DevicesCollection dc = new DevicesCollection();
Guid g;
g = dc[1].DriverGuid;
dv = new Device(g);
dv.SetCooperativeLevel(this, CooperativeLevel.Normal);
wfx = new WaveFormat();
wfx.FormatTag = WaveFormatTag.Pcm; //4
wfx.Channels = 1; //2
wfx.SamplesPerSecond = 8000; //4
wfx.BitsPerSample = 16; //2
wfx.BlockAlign = (short)(wfx.BitsPerSample / 8 * wfx.Channels); //2
wfx.AverageBytesPerSecond = wfx.SamplesPerSecond * wfx.BlockAlign * 3; //4
bd = new BufferDescription();
bd.Format = wfx;
bd.BufferBytes = wfx.AverageBytesPerSecond;
bd.ControlVolume = true;
bd.ControlPositionNotify = true;
bd.CanGetCurrentPosition = true;
bd.Control3D = false;
bd.ControlEffects = false;
bd.ControlFrequency = true;
bd.ControlPan = true;
bd.GlobalFocus = true;
SecondaryBuffer buf = new SecondaryBuffer(bd, dv); 值不在预期范围内
Guid g;
g = dc[1].DriverGuid;
dv = new Device(g);
dv.SetCooperativeLevel(this, CooperativeLevel.Normal);
wfx = new WaveFormat();
wfx.FormatTag = WaveFormatTag.Pcm; //4
wfx.Channels = 1; //2
wfx.SamplesPerSecond = 8000; //4
wfx.BitsPerSample = 16; //2
wfx.BlockAlign = (short)(wfx.BitsPerSample / 8 * wfx.Channels); //2
wfx.AverageBytesPerSecond = wfx.SamplesPerSecond * wfx.BlockAlign * 3; //4
bd = new BufferDescription();
bd.Format = wfx;
bd.BufferBytes = wfx.AverageBytesPerSecond;
bd.ControlVolume = true;
bd.ControlPositionNotify = true;
bd.CanGetCurrentPosition = true;
bd.Control3D = false;
bd.ControlEffects = false;
bd.ControlFrequency = true;
bd.ControlPan = true;
bd.GlobalFocus = true;
SecondaryBuffer buf = new SecondaryBuffer(bd, dv); 值不在预期范围内
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货