render: clamp audio samples when finalized

This commit is contained in:
itsmattkc
2022-05-27 10:04:30 -07:00
parent c2570b23c3
commit 6a65c0fa38
3 changed files with 52 additions and 5 deletions
+6
View File
@@ -71,6 +71,8 @@ public:
return r;
}
int channel_count() const { return data_.size(); }
bool is_allocated() const;
void allocate();
void destroy();
@@ -82,6 +84,8 @@ public:
void transform_volume_for_sample(int sample_index, float volume);
void transform_volume_for_sample_on_channel(int sample_index, int channel, float volume);
void clamp();
void silence();
void silence(int start_sample, int end_sample);
void silence_bytes(int start_byte, int end_byte);
@@ -93,6 +97,8 @@ public:
}
private:
void clamp_channel(int channel);
AudioParams audio_params_;
int sample_count_per_channel_;