AudioDataLib
A C++ library of classes supporting a variety of audio-data tasks.
Loading...
Searching...
No Matches
AudioDataLib::WaveFileFormat Class Reference

This class knows how to read and write WAVE files. More...

#include <WaveFileFormat.h>

Inheritance diagram for AudioDataLib::WaveFileFormat:
AudioDataLib::FileFormat

Classes

class  WaveChunkParser
 

Public Types

enum  SampleFormat { PCM = 1 , IEEE_FLOAT = 3 }
 

Public Member Functions

 WaveFileFormat ()
 
virtual ~WaveFileFormat ()
 
virtual bool ReadFromStream (ByteStream &inputStream, FileData *&fileData, Error &error) override
 
virtual bool WriteToStream (ByteStream &outputStream, const FileData *fileData, Error &error) override
 
- Public Member Functions inherited from AudioDataLib::FileFormat
 FileFormat ()
 
virtual ~FileFormat ()
 

Static Protected Member Functions

static bool LoadWaveData (AudioData *audioData, const ChunkParser::Chunk *waveChunk, Error &error)
 

Friends

class DownloadableSoundFormat
 

Additional Inherited Members

- Static Public Member Functions inherited from AudioDataLib::FileFormat
static std::shared_ptr< FileFormatCreateForFile (const std::string &filePath)
 

Detailed Description

This class knows how to read and write WAVE files.

Wave files are a common, uncompressed (and therefore lossless) audio format, containing audio data in PCM (pulse code modulation) or floating-point format. I still need to add support unsigned PCM once I get my hands on an example file.

Member Enumeration Documentation

◆ SampleFormat

Enumerator
PCM 
IEEE_FLOAT 

Constructor & Destructor Documentation

◆ WaveFileFormat()

WaveFileFormat::WaveFileFormat ( )

◆ ~WaveFileFormat()

WaveFileFormat::~WaveFileFormat ( )
virtual

Member Function Documentation

◆ LoadWaveData()

bool WaveFileFormat::LoadWaveData ( AudioData * audioData,
const ChunkParser::Chunk * waveChunk,
Error & error )
staticprotected

◆ ReadFromStream()

bool WaveFileFormat::ReadFromStream ( ByteStream & inputStream,
FileData *& fileData,
Error & error )
overridevirtual

The given file data pointer is assigned an instance of some derivative of the FileData class which is, in turn, populated with the data found in the given stream.

Parameters
[in,out]inputStreamThis must be a ByteStream derivative that can handle read operations.
[out]fileDataOn success, this pointer is assigned a heap allocation the user is reponsible for freeing.
[out]errorThis will contain error information if false is returned.
Returns
True is returned on success; false otherwise.

Implements AudioDataLib::FileFormat.

◆ WriteToStream()

bool WaveFileFormat::WriteToStream ( ByteStream & outputStream,
const FileData * fileData,
Error & error )
overridevirtual

The given file data is written to the given stream.

Parameters
[out]outputStreamThis must be a ByteStream derivative that can accept write operations.
[in]fileDataThis is the file data to be written to the stream.
[out]errorThis will contain error information if false is returned.
Returns
True is returned on success; false otherwise.

Implements AudioDataLib::FileFormat.

Friends And Related Symbol Documentation

◆ DownloadableSoundFormat

friend class DownloadableSoundFormat
friend

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