3月25日整理

一、waveOut的API

二、配置板子



一、waveOut的API

1、waveOutOpen

这个函数打开一个指定的波形输出设备来播放。

句法:

MMRESULT waveOutOpen(
  LPHWAVEOUT phwo,
  UINT uDeviceID,
  LPWAVEFORMATEX pwfx,
  DWORD dwCallback,
  DWORD dwInstance,
  DWORD fdwOpen
);


参数:

Phwo
Address filled with a handle identifying the open waveform-audio output device. Use the handle to identify the device when calling other waveform-audio output functions. This parameter might be NULL if the WAVE_FORMAT_QUERY flag is specified for fdwOpen.

uDeviceID
Device identifier of the waveform-audio output device to open. You can use the following flag instead of a device identifier.

pwfx
Pointer to a WAVEFORMATEX (Waveform Audio) structure that identifies the format of the waveform- audio data to be sent to the device. You can free this structure immediately after passing it to waveOutOpen.

dwCallback
Specifies the address of a fixed callback function, an event handle, a handle to a window, or the identifier of a thread to be called during waveform-audio playback to process messages related to the progress of the playback. If no callback function is required, this value can be zero.

dwInstance
Specifies user-instance data passed to the callback mechanism. This parameter is not used with the window callback mechanism.

fdwOpen
Flags for opening the device. The following table shows the possible values.

2、waveOutClose

这个函数关闭指定的波形输出设备。

句法:

MMRESULT waveOutClose(
  HWAVEOUT hwo 
); 

参数:

hwo
Handle to the waveform-audio output device. If the function succeeds, the handle is no longer valid after this call.


3、waveOutPrepareHeader

这个函数准备波形数据块进行播放。

句法:

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

参数:

hwo
Handle to the waveform-audio output device.

pwh
Pointer to a WAVEHDR structure that identifies the data block to be prepared. The buffer's base address must be aligned with the respect to the sample size.

cbwh
Size, in bytes, of the WAVEHDR structure.


4、waveOutUnprepareHeader

This function cleans up the preparation performed by waveOutPrepareHeader. 

句法:

MMRESULT waveOutUnprepareHeader(
  HWAVEOUT hwo, 
  LPWAVEHDR pwh, 
  UINT cbwh 
); 

参数:

hwo
Handle to the waveform-audio output device.

pwh
Pointer to a WAVEHDR structure identifying the data block to be cleaned up.

cbwh
Size, in bytes, of the WAVEHDR structure.


5、waveOutWrite

这个函数将一个数据块发送到一个指定的波形音频输出装置。

句法:

MMRESULT waveOutWrite(
  HWAVEOUT hwo,
  LPWAVEHDR pwh,
  UINT cbwh
);

参数:

hwo
Handle to the waveform-audio output device.

pwh
Pointer to a WAVEHDR structure containing information about the data block.

cbwh
Size, in bytes, of the WAVEHDR structure.


6、WAVEHDR

这个结构定义了标题用于识别波形音频缓冲区。

句法:

typedef struct {
  LPSTR lpData;
  DWORD dwBufferLength;
  DWORD dwBytesRecorded;
  DWORD dwUser;
  DWORD dwFlags;
  DWORD dwLoops;
  struct wavehdr_tag* lpNext;
  DWORD reserved;}
WAVEHDR;

参数:

lpData
Long pointer to the address of the waveform buffer. This buffer must be block-aligned according to the nBlockAlign member of the WAVEFORMATEX structure used to open the device.

dwBufferLength
Specifies the length, in bytes, of the buffer.

dwBytesRecorded
When the header is used in input, this member specifies how much data is in the buffer. When the header is used in output, this member specifies the number of bytes played from the buffer.

dwUser
Specifies user data.

dwFlags
Specifies information about the buffer. The following table shows the possible values.

dwLoops
Specifies the number of times to play the loop. This member is used only with output buffers.

lpNext
Reserved. This member is used within the audio driver to maintain a first-in, first-out linked list of headers awaiting playback.

reserved
Reserved.


二、配置板子

1、运行SDInstall,打开目录,把加载MT3360_BootLoad.bin,安装到SD卡上;





2、打开MTKTool,选择115200,拔出读卡器中的SD卡,插到板子上再选115200×8,重启板子,重启过程中,按空格键;



3、遇到选项,选8选项,打开MTKWCEDownload,选路径,打开xip.nbo文件,然后下载。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值