Gorgon Game Engine
FLAC Class Reference

Provides FLAC encoding support. More...

Public Member Functions

 FLAC (int buffersize=1024)
 
 ~FLAC ()
 
void Decode (const std::string &filename, Containers::Wave &wave)
 Decodes given FLAC compressed file and fills a wave container. More...
 
void Decode (const std::vector< Byte > &input, Containers::Wave &wave)
 Decodes given FLAC compressed data and fills a wave container. More...
 
void Decode (std::istream &input, Containers::Wave &wave)
 Decodes given FLAC compressed data and fills a wave container. More...
 
void Encode (const Containers::Wave &input, const std::string &filename, int bps=16)
 Encodes the given wave data to FLAC compressed data. More...
 
void Encode (const Containers::Wave &input, std::ostream &output, int bps=16)
 Encodes the given wave data to FLAC compressed data. More...
 
void Encode (const Containers::Wave &input, std::vector< Byte > &output, int bps=16)
 Encodes the given wave data to FLAC compressed data. More...
 

Detailed Description

Provides FLAC encoding support.

Constructor & Destructor Documentation

◆ FLAC()

FLAC ( int  buffersize = 1024)

◆ ~FLAC()

~FLAC ( )

Member Function Documentation

◆ Decode() [1/3]

void Decode ( const std::string &  filename,
Containers::Wave wave 
)

Decodes given FLAC compressed file and fills a wave container.

References FLAC::Decode().

◆ Decode() [2/3]

void Decode ( const std::vector< Byte > &  input,
Containers::Wave wave 
)

◆ Decode() [3/3]

void Decode ( std::istream &  input,
Containers::Wave wave 
)

◆ Encode() [1/3]

void Encode ( const Containers::Wave input,
const std::string &  filename,
int  bps = 16 
)

Encodes the given wave data to FLAC compressed data.

bps is the bit/sample. It is best to use original bit/sample if re-saving a file. Lower values will save disk space while sacrificing quality. Current FLAC implementation supports 4 - 24 bit/sample. Channel layout is saved as is, and it is the responsibility of the caller to make it compatible with the standard layout. This function is not thread safe, you need one FLAC object per thread.

References FLAC::Encode().

◆ Encode() [2/3]

void Encode ( const Containers::Wave input,
std::ostream &  output,
int  bps = 16 
)

Encodes the given wave data to FLAC compressed data.

bps is the bit/sample. It is best to use original bit/sample if re-saving a file. Lower values will save disk space while sacrificing quality. Current FLAC implementation supports 4 - 24 bit/sample. Channel layout is saved as is, and it is the responsibility of the caller to make it compatible with the standard layout. This function is not thread safe, you need one FLAC object per thread.

References Gorgon::Encoding::stream_encode_seek(), Gorgon::Encoding::stream_encode_tell(), and Gorgon::Encoding::stream_encode_write().

◆ Encode() [3/3]

void Encode ( const Containers::Wave input,
std::vector< Byte > &  output,
int  bps = 16 
)

Encodes the given wave data to FLAC compressed data.

bps is the bit/sample. It is best to use original bit/sample if re-saving a file. Lower values will save disk space while sacrificing quality. Current FLAC implementation supports 4 - 24 bit/sample. Channel layout is saved as is, and it is the responsibility of the caller to make it compatible with the standard layout.

References Gorgon::Encoding::vector_encode_seek(), Gorgon::Encoding::vector_encode_tell(), and Gorgon::Encoding::vector_encode_write().


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