mmioRead

The mmioRead function reads a specified number of bytes from a file opened by using the mmioOpenfunction.

本函数读取指定数量的字节,从一个文件,使用mmioOpen函数.

Syntax

LONG mmioRead(   HMMIO hmmio,   HPSTR pch,   LONG cch ); 

Parameters

hmmio

File handle of the file to be read.

文件句柄,被读取的文件的句柄

pch

Pointer to a buffer to contain the data read from the file.

指向一个缓冲区,包含/存放从文件读取的数据

cch

Number of bytes to read from the file.

要从文件读取的字节数

Return value

Returns the number of bytes actually read. If the end of the file has been reached and no more bytes can be read, the return value is 0. If there is an error reading from the file, the return value is –1.

返回实际读取的字节数.如果已经到达文件尾并且没有更多的字节可供读取,返回值为0,如果从文件读取时发生错误,返回值为-1

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Mmsystem.h (include Windows.h)

Library

Winmm.lib

DLL

Winmm.dll

 

 

Send comments about this topic to Microsoft

Build date: 9/7/2011

http://msdn.microsoft.com/en-us/library/dd757334(v=VS.85).aspx?ppud=4


 
 

BOOL CAudioCtrl::ReadSoundDataFromFile(LPVOID data, int &size)
{
ASSERT ( data && size > 0 );
ASSERT ( m_hWaveFile[ENUM_FILE_CHANNEL_COMMON] );
return ( ( size = ::mmioRead ( m_hWaveFile[ENUM_FILE_CHANNEL_COMMON], (char*)data, size) ) > 0 );
}


/* 用mmioRead()读出WAVEFormatx结构数据 */
DWORD bytesRead = mmioRead ( m_hWaveFile[ENUM_FILE_CHANNEL_COMMON],(LPSTR)&m_Format,
m_MMCKInfoChild[ENUM_FILE_CHANNEL_COMMON].cksize );


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值