coastline 0.0.4
Loading...
Searching...
No Matches
wavread.h File Reference

The reading of wave files through the multimedia I/O of Windows. More...

#include <windows.h>
#include <mmreg.h>
#include <mmsystem.h>
Include dependency graph for wavread.h:

Go to the source code of this file.

Macros

#define WAVE_ERROR_MEMORY   0xe000
 Global memory was not allocated.
#define WAVE_ERROR_CANNOT_OPEN   0xe100
 The file was not opened.
#define WAVE_ERROR_NOT_WAVE_FILE   0xe101
 The file is not a wave file.
#define WAVE_ERROR_CANNOT_READ   0xe102
 The file was not read.
#define WAVE_ERROR_CORRUPT_WAVE_FILE   0xe103
 The data of the file ends early.

Functions

int WaveOpenFile (const char *pszPath, HMMIO *phmmio, WAVEFORMATEX **ppFormat, MMCKINFO *pckRiff)
 Open a wave file and read its format into global memory, leaving the file at the end of the chunk of the format.
int WaveStartDataRead (HMMIO *phmmio, MMCKINFO *pckData, MMCKINFO *pckRiff)
 Seek to the start of the RIFF of an open wave file and descend into its chunk of data.
int WaveReadFile (HMMIO hmmio, DWORD dwRead, BYTE *pDest, MMCKINFO *pckData, DWORD *pdwActualRead)
 Read data from the chunk of data of an open wave file.
int WaveLoadFile (const char *pszPath, DWORD *pdwSize, DWORD *pdwSamples, WAVEFORMATEX **ppFormat, void **ppData)
 Read a wave file into global memory.

Detailed Description

The reading of wave files through the multimedia I/O of Windows.

Macro Definition Documentation

◆ WAVE_ERROR_MEMORY

#define WAVE_ERROR_MEMORY   0xe000

Global memory was not allocated.

◆ WAVE_ERROR_CANNOT_OPEN

#define WAVE_ERROR_CANNOT_OPEN   0xe100

The file was not opened.

◆ WAVE_ERROR_NOT_WAVE_FILE

#define WAVE_ERROR_NOT_WAVE_FILE   0xe101

The file is not a wave file.

◆ WAVE_ERROR_CANNOT_READ

#define WAVE_ERROR_CANNOT_READ   0xe102

The file was not read.

◆ WAVE_ERROR_CORRUPT_WAVE_FILE

#define WAVE_ERROR_CORRUPT_WAVE_FILE   0xe103

The data of the file ends early.

Function Documentation

◆ WaveOpenFile()

int WaveOpenFile ( const char * pszPath,
HMMIO * phmmio,
WAVEFORMATEX ** ppFormat,
MMCKINFO * pckRiff )

Open a wave file and read its format into global memory, leaving the file at the end of the chunk of the format.

Parameters
pszPathThe path of the file.
phmmioReceives the open file, or null.
ppFormatReceives the format, or null.
pckRiffReceives the chunk of the RIFF.
Returns
0, a WAVE_ERROR_ value, or the error of the multimedia I/O.
Ghidra address:
BRD3D: 0x10076ce0
Ghidra address:
BRGlide: 0x1006ffc0

◆ WaveStartDataRead()

int WaveStartDataRead ( HMMIO * phmmio,
MMCKINFO * pckData,
MMCKINFO * pckRiff )

Seek to the start of the RIFF of an open wave file and descend into its chunk of data.

Parameters
phmmioThe open file.
pckDataReceives the chunk of data.
pckRiffThe chunk of the RIFF.
Returns
The result of mmioDescend().
Ghidra address:
BRD3D: 0x10076e90
Ghidra address:
BRGlide: 0x10070170

◆ WaveReadFile()

int WaveReadFile ( HMMIO hmmio,
DWORD dwRead,
BYTE * pDest,
MMCKINFO * pckData,
DWORD * pdwActualRead )

Read data from the chunk of data of an open wave file.

Parameters
hmmioThe open file.
dwReadThe bytes to read, limited to the bytes left in the chunk.
pDestReceives the data.
pckDataThe chunk of data, whose size is reduced by the bytes read.
pdwActualReadReceives the bytes read, or 0 on an error.
Returns
0, 1 when the information of the file is not read, WAVE_ERROR_CORRUPT_WAVE_FILE, or the error of the multimedia I/O.
Ghidra address:
BRD3D: 0x10076ed0
Ghidra address:
BRGlide: 0x100701b0

◆ WaveLoadFile()

int WaveLoadFile ( const char * pszPath,
DWORD * pdwSize,
DWORD * pdwSamples,
WAVEFORMATEX ** ppFormat,
void ** ppData )

Read a wave file into global memory.

Parameters
pszPathThe path of the file.
pdwSizeReceives the size of the data.
pdwSamplesNot written.
ppFormatReceives the format.
ppDataReceives the data.
Returns
0, a WAVE_ERROR_ value, or the error of the multimedia I/O.
Ghidra address:
BRD3D: 0x10076fa0
Ghidra address:
BRGlide: 0x10070280