coastline 0.0.4
Loading...
Searching...
No Matches
flactrack.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <filesystem>
5#include <memory>
6#include <vector>
7
8#include <FLAC/stream_decoder.h>
9
10namespace coastline {
11
13class FlacTrack {
14public:
22 bool Open(const std::filesystem::path &path);
23
32
33private:
35 struct DecoderDeleter {
37 void operator()(FLAC__StreamDecoder *decoder) const;
38 };
39 static FLAC__StreamDecoderWriteStatus Write(const FLAC__StreamDecoder *,
40 const FLAC__Frame *frame,
41 const FLAC__int32 *const buffer[],
42 void *user);
43 static void Error(const FLAC__StreamDecoder *, FLAC__StreamDecoderErrorStatus status, void *);
44
47 std::size_t m_read = 0;
48};
49
50} // namespace coastline
Decode imported FLAC tracks into stereo PCM without discarding block remainders.
Definition flactrack.h:13
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.
Definition assetimport.h:11