coastline 0.0.4
Loading...
Searching...
No Matches
coastline::FlacTrack Class Reference

Decode imported FLAC tracks into stereo PCM without discarding block remainders. More...

#include <flactrack.h>

Public Member Functions

bool Open (const std::filesystem::path &path)
 Open an imported track, replacing any previous decoder and pending samples.
bool Decode (std::vector< std::int16_t > &output, std::size_t frames)
 Append at most the requested stereo frames without discarding unused block samples.

Detailed Description

Decode imported FLAC tracks into stereo PCM without discarding block remainders.

Member Function Documentation

◆ Open()

bool coastline::FlacTrack::Open ( const std::filesystem::path & path)

Open an imported track, replacing any previous decoder and pending samples.

Mono samples duplicate into both output channels; multichannel input uses its first two.

Parameters
pathThe FLAC file to decode.
Returns
Whether decoder initialisation succeeded.

◆ Decode()

bool coastline::FlacTrack::Decode ( std::vector< std::int16_t > & output,
std::size_t frames )

Append at most the requested stereo frames without discarding unused block samples.

Parameters
outputReceives interleaved signed 16-bit left and right samples.
framesThe maximum number of stereo frames to append.
Returns
Whether the decoder remains active. Output may grow even when false is returned.

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