UtiLite  0.3.1
A lite utilities library
Classes | Public Member Functions
UWav Class Reference

#include <UWav.h>

List of all members.

Classes

struct  ChunkHeader
struct  DataChunk
struct  FmtChunk
struct  WavHeader

Public Member Functions

int init (const char *fileName)
long readData (unsigned char data[], long offset, long dataLength)
long readNextData (unsigned char data[], long dataLength)
long readNextSamples (short samples[], long numSamples)

Detailed Description

This class represents a WAV file. When initiated, it reads the file headers and keep informations in his attributes accessibles with the getters. The data aren't read at the initialization.


Member Function Documentation

int UWav::init ( const char *  fileName)

It reads the file headers to fill wav structures.

Parameters:
fileNamethe file name
Returns:
int 0 if success, otherwise an error code
long UWav::readData ( unsigned char  data[],
long  offset,
long  dataLength 
)

Read the data from the offset.

Parameters:
databuffer for the data read
offsetoffset where the data begin to be read.
dataLengthlength of the data buffer
Returns:
long bytes read
long UWav::readNextData ( unsigned char  data[],
long  dataLength 
)

Read the next data depending on the last call. First call to this method will read from the beginning of the data chunk.

Parameters:
databuffer for the data read
dataLengthlength of the data buffer
Returns:
long bytes read
long UWav::readNextSamples ( short  samples[],
long  numSamples 
)

Read the next samples (16 bits per samples).

Parameters:
samplesbuffer for the samples read
numSampleslength of the samples buffer
Returns:
long samples read

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Friends Defines