 |
Gorgon Game Engine
|
Go to the documentation of this file.
3 #include "../Containers/Wave.h"
6 namespace Gorgon {
namespace Encoding {
13 FLAC(
int buffersize = 1024);
30 std::ofstream stream(filename, std::ios::binary);
31 Encode(input, stream, bps);
48 std::ifstream stream(filename, std::ios::binary);
49 if(!stream.is_open())
throw std::runtime_error(
"Cannot open file");
50 return Decode(stream, wave);
62 std::vector<int32_t> buffer;
63 std::streampos maxpos;
75 void Seek(std::size_t destination);
FlacStream(const I_ &input, Containers::Wave &output)
FLAC__StreamEncoderSeekStatus stream_encode_seek(const FLAC__StreamEncoder *, FLAC__uint64 absolute_byte_offset, void *client_data)
Definition: FLAC.cpp:103
FLAC__StreamDecoderWriteStatus decode_write(const FLAC__StreamDecoder *, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data)
Definition: FLAC.cpp:201
std::vector< Channel > StandardChannels(int channelcount)
Definition: Basic.h:39
FLAC__StreamEncoderWriteStatus stream_encode_write(const FLAC__StreamEncoder *, const FLAC__byte buffer[], size_t bytes, unsigned, unsigned, void *client_data)
Definition: FLAC.cpp:92
FLAC Flac
Definition: FLAC.cpp:419
~FLAC()
Definition: FLAC.cpp:288
void Assume(float *newdata, unsigned long size)
Assumes the ownership of the data.
Definition: Wave.h:299
void Decode(std::istream &input, Containers::Wave &wave)
Decodes given FLAC compressed data and fills a wave container.
Definition: FLAC.cpp:342
FLAC__StreamEncoderTellStatus stream_encode_tell(const FLAC__StreamEncoder *, FLAC__uint64 *absolute_byte_offset, void *client_data)
Definition: FLAC.cpp:117
Provides FLAC encoding support.
Definition: FLAC.h:11
FLAC__StreamEncoderWriteStatus vector_encode_write(const FLAC__StreamEncoder *, const FLAC__byte buffer[], size_t bytes, unsigned, unsigned, void *client_data)
Definition: FLAC.cpp:127
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
void Decode(const std::string &filename, Containers::Wave &wave)
Decodes given FLAC compressed file and fills a wave container.
Definition: FLAC.h:47
void SetSampleRate(unsigned rate)
Sets the number samples per second.
Definition: Wave.h:456
FLAC__StreamEncoderSeekStatus vector_encode_seek(const FLAC__StreamEncoder *, FLAC__uint64 absolute_byte_offset, void *client_data)
Definition: FLAC.cpp:140
unsigned GetChannelCount() const
Returns the number of channels that this wave data has.
Definition: Wave.h:420
FLAC__StreamDecoderReadStatus stream_decode_read(const FLAC__StreamDecoder *, FLAC__byte buffer[], size_t *bytes, void *client_data)
Definition: FLAC.cpp:163
void Encode(const Containers::Wave &input, const std::string &filename, int bps=16)
Encodes the given wave data to FLAC compressed data.
Definition: FLAC.h:29
void decode_error(const FLAC__StreamDecoder *, FLAC__StreamDecoderErrorStatus, void *)
Definition: FLAC.cpp:230
void Encode(const Containers::Wave &input, std::ostream &output, int bps=16)
Encodes the given wave data to FLAC compressed data.
Definition: FLAC.cpp:291
FLAC__StreamEncoderTellStatus vector_encode_tell(const FLAC__StreamEncoder *, FLAC__uint64 *absolute_byte_offset, void *client_data)
Definition: FLAC.cpp:153
FLAC__StreamDecoderReadStatus vector_decode_read(const FLAC__StreamDecoder *, FLAC__byte buffer[], size_t *bytes, void *client_data)
Definition: FLAC.cpp:179
This class is a container for wave data.
Definition: Wave.h:17
void Seek(std::size_t destination)
FLAC(int buffersize=1024)
Definition: FLAC.cpp:284
unsigned long GetSize() const
Returns the size of the wave.
Definition: Wave.h:405
unsigned GetSampleRate() const
Returns the number of samples per second.
Definition: Wave.h:451