45 const size_t target_bytes_per_frame = target_bytes_per_sample * this->
channels_.count();
47 filtered_data.resize(target_bytes_per_frame * total_frames);
49 uint8_t *current_data = filtered_data.data();
51 for (
uint32_t frame_index = 0; frame_index < total_frames; ++frame_index) {
52 for (
uint32_t channel_index = 0; channel_index < source_channels; ++channel_index) {
53 if (this->
channels_.test(channel_index)) {
56 const uint32_t sample_index = frame_index * source_bytes_per_frame + channel_index * source_bytes_per_sample;
65 sample = clamp<int32_t>(sample, Q25_MIN_VALUE, Q25_MAX_VALUE);
70 current_data = current_data + target_bytes_per_sample;
void pack_q31_as_audio_sample(int32_t sample, uint8_t *data, size_t bytes_per_sample)
Packs a Q31 fixed-point number as an audio sample with the specified number of bytes per sample.