1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-04 19:21:46 +00:00

Merge pull request #100559 from DeeJayLSP/save-wav-vector

Reduce memory overhead of `save_to_wav`
This commit is contained in:
Thaddeus Crews
2025-06-02 18:51:48 -05:00

View File

@@ -576,8 +576,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++) {