25 bool Load(
SoundEntry &sound,
bool new_format, std::vector<uint8_t> &data)
override
32 if (new_format)
return false;
39 data.reserve(sound.file_size + 1);
40 data.resize(sound.file_size);
41 sound.file->
ReadBlock(std::data(data), std::size(data));
44 for (
auto &sample : data) {
45 sample = sample - 128;
void ReadBlock(void *ptr, size_t size)
Read a block.
Raw PCM sound loader, used as a fallback if other sound loaders fail.
static constexpr uint16_t RAW_SAMPLE_RATE
Sample rate of raw pcm samples.
static constexpr uint8_t RAW_SAMPLE_BITS
Bit depths of raw pcm samples.
Base interface for a SoundLoader implementation.
Class related to random access to files.
A number of safeguards to prevent using unsafe methods.
Types related to sound loaders.
Definition of base types and functions in a cross-platform compatible way.