Reduce memory overhead of save_to_wav

This commit is contained in:
DeeJayLSP 2025-03-19 13:19:10 -03:00
parent ef1153baf3
commit 044444f2e2

View file

@ -580,8 +580,7 @@ Error AudioStreamWAV::save_to_wav(const String &p_path) {
file->store_32(sub_chunk_2_size); //Subchunk2Size
// Add data
Vector<uint8_t> stream_data = get_data();
const uint8_t *read_data = stream_data.ptr();
const uint8_t *read_data = data.ptr();
switch (format) {
case AudioStreamWAV::FORMAT_8_BITS:
for (unsigned int i = 0; i < data_bytes; i++) {