SecondaryBuffer 构造函数提示“值不在预期范围内”

cslione2588 2012-06-04 01:28:56
求帮助

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); 值不在预期范围内
...全文
242 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Spiritfort 2021-07-07
  • 打赏
  • 举报
回复

楼主解决了没有??我也有这个问题

tanta 2012-07-22
  • 打赏
  • 举报
回复 1
缓冲区小了。
Spiritfort 2021-07-07
  • 举报
回复
@tanta 什么意思
bdmh 2012-07-21
  • 打赏
  • 举报
回复
调试吧,跟踪SecondaryBuffer构造函数,估计数据格式不正确

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧