arcsdec::v_1_0_0::AudioReader class final

Read audio files and provide the decoded samples.

A AudioReader can process an audio file and return the processing results.

Base classes

class v_1_0_0::FileReader
Abstract base class for FileReaders.

Constructors, destructors, conversion operators

AudioReader(std::unique_ptr<AudioReaderImpl> impl) explicit
Constructor with a concrete implementation.
AudioReader(std::unique_ptr<AudioReaderImpl> impl, SampleProcessor& proc)
Constructor with a concrete implementation and a SampleProcessor.
~AudioReader() override noexcept
Default destructor.

Public functions

auto acquire_size(const std::string& filename) const -> std::unique_ptr<AudioSize>
Acquire the AudioSize of a file.
void process_file(const std::string& filename)
Process the file and return ARCSs v1 and v2 for all tracks.
auto samples_per_read() const -> std::size_t
Return the number of samples to read in one read operation.
void set_processor(SampleProcessor& processor)
Register a SampleProcessor instance to pass the read samples to.
void set_samples_per_read(const std::size_t samples_per_read)
Set the number of samples to read in one read operation.

Function documentation

arcsdec::v_1_0_0::AudioReader::AudioReader(std::unique_ptr<AudioReaderImpl> impl) explicit

Constructor with a concrete implementation.

Parameters
impl in The implementation of this instance

arcsdec::v_1_0_0::AudioReader::AudioReader(std::unique_ptr<AudioReaderImpl> impl, SampleProcessor& proc)

Constructor with a concrete implementation and a SampleProcessor.

Parameters
impl in AudioReader implementation to use
proc in SampleProcessor to use

std::unique_ptr<AudioSize> arcsdec::v_1_0_0::AudioReader::acquire_size(const std::string& filename) const

Acquire the AudioSize of a file.

Parameters
filename in The filename of the file to process
Returns AudioSize for the specified file
Exceptions
FileReadException If the file could not be read

Acquiring the AudioSize includes validation.

void arcsdec::v_1_0_0::AudioReader::process_file(const std::string& filename)

Process the file and return ARCSs v1 and v2 for all tracks.

Parameters
filename in The filename of the file to process
Returns The checksums of this file
Exceptions
FileReadException If the file could not be read

std::size_t arcsdec::v_1_0_0::AudioReader::samples_per_read() const

Return the number of samples to read in one read operation.

Returns Number of samples per read operation.

void arcsdec::v_1_0_0::AudioReader::set_processor(SampleProcessor& processor)

Register a SampleProcessor instance to pass the read samples to.

Parameters
processor in SampleProcessor to use

void arcsdec::v_1_0_0::AudioReader::set_samples_per_read(const std::size_t samples_per_read)

Set the number of samples to read in one read operation.

Parameters
samples_per_read in The number of 32 bit PCM samples per read

The default is BLOCKSIZE::DEFAULT.