waveOutPrepareHeader

http://msdn.microsoft.com/en-us/library/ms713756(v=VS.85).aspx

waveOutPrepareHeader(HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);


 
  

MMRESULT waveOutPrepareHeader(
HWAVEOUT hwo, /* 波形音频输出设备的句柄 */
LPWAVEHDR pwh, /* 一个WAVEHDR结构的指针 */
UINT cbwh /* WAVEHDR结构的大小,以字节 */

);


返回值:

如果成功,返回MMSYSERR_NOERROR.否则,返回错误,可能的错误值为:

ValueDescription
MMSYSERR_INVALHANDLESpecified device handle is invalid.
MMSYSERR_NODRIVERNo device driver is present.
MMSYSERR_NOMEMUnable to allocate or lock memory.

备注:

调用此函数之前必须设置WAVEHDR结构的lpData,dwBufferLength,dwFlags中成员。 dwFlags成员必须设置为WHDR_PREPAREDWHDR_BEGINLOOP,或WHDR_ENDLOOP

 
  

/* flags for dwFlags field of WAVEHDR */
#define WHDR_DONE 0x00000001 /* done bit */
#define WHDR_PREPARED 0x00000002 /* set if this header has been prepared */
#define WHDR_BEGINLOOP 0x00000004 /* loop start block */
#define WHDR_ENDLOOP 0x00000008 /* loop end block */
#define WHDR_INQUEUE 0x00000010 /* reserved for driver */ 0001 0000 :16


依次是:1,2,4,8,16

0000 0001

0000 0010

0000 0100

0000 1000

0001 0000


The dwFlags , dwBufferLength , and dwLoops members of the WAVEHDR structure can change between calls to this function and the waveOutWrite function. (The only flags that can change in this interval for the dwFlags member are WHDR_BEGINLOOP and WHDR_ENDLOOP.) If you change the size specified by dwBufferLength before the call to waveOutWrite , the new value must be less than the prepared value.

Preparing a header that has already been prepared has no effect, and the function returns zero.

Requirements

Windows NT/2000/XP: Included in Windows NT 3.1 and later. 
Windows 95/98/Me: Included in Windows 95 and later. 
Header: Declared in Mmsystem.h; include Windows.h. 
Library: Use Winmm.lib.


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值