newspeoplefor developersdocumentationdownloads

nAudioFile Class Reference
[Audio Subsystem]

#include <naudiofile.h>

Inheritance diagram for nAudioFile:

nOggFile nWavFile List of all members.

Detailed Description

A generic base class for read access to audio files. Derive subclass for specific file formats/codecs.

(C) 2005 Radon Labs GmbH

Definition at line 20 of file naudiofile.h.


Public Member Functions

 nAudioFile ()
 constructor
virtual ~nAudioFile ()
 destructor
virtual bool Open (const nString &filename)
 open the file
virtual void Close ()
 close the file
bool IsOpen () const
 return true if currently open
virtual uint Read (void *buffer, uint bytesToRead)
 read bytes from file
virtual bool Reset ()
 reset to beginning of audio data
virtual int GetSize () const
 return size of audio data in file in bytes
virtual WAVEFORMATEX * GetFormat () const
 return pointer to format description

Protected Attributes

bool isOpen

Constructor & Destructor Documentation

nAudioFile::nAudioFile  ) 
 

constructor

Definition at line 10 of file naudiofile.cc.

nAudioFile::~nAudioFile  )  [virtual]
 

destructor

Definition at line 19 of file naudiofile.cc.


Member Function Documentation

bool nAudioFile::Open const nString filename  )  [virtual]
 

open the file

Open the file for reading. The method should open the file and read the file's header data.

Reimplemented in nOggFile, and nWavFile.

Definition at line 30 of file naudiofile.cc.

void nAudioFile::Close  )  [virtual]
 

close the file

Close the file.

Reimplemented in nOggFile, and nWavFile.

Definition at line 42 of file naudiofile.cc.

bool nAudioFile::IsOpen  )  const [inline]
 

return true if currently open

Definition at line 51 of file naudiofile.h.

uint nAudioFile::Read void *  buffer,
uint  bytesToRead
[virtual]
 

read bytes from file

Read data from file. Returns the number of bytes actually read. If decoding happens inside Read() the number of bytes to read and number of bytes actually read means "decoded data". The method should wrap around if the end of the data is encountered.

Reimplemented in nOggFile, and nWavFile.

Definition at line 56 of file naudiofile.cc.

bool nAudioFile::Reset  )  [virtual]
 

reset to beginning of audio data

Reset the object to the beginning of the audio data.

Reimplemented in nOggFile, and nWavFile.

Definition at line 67 of file naudiofile.cc.

int nAudioFile::GetSize  )  const [virtual]
 

return size of audio data in file in bytes

This method returns the (decoded) size of audio data in the file in bytes.

Reimplemented in nOggFile, and nWavFile.

Definition at line 78 of file naudiofile.cc.

WAVEFORMATEX * nAudioFile::GetFormat  )  const [virtual]
 

return pointer to format description

This method returns a pointer to a WAVEFORMATEX structure which describes the format of the audio data in the file.

Reimplemented in nOggFile, and nWavFile.

Definition at line 90 of file naudiofile.cc.


Member Data Documentation

bool nAudioFile::isOpen [protected]
 

Definition at line 43 of file naudiofile.h.


The documentation for this class was generated from the following files:

Copyright © 1999-2005 by the contributing authors. Ideas, requests, problems: Send feedback.