fix(bridge): WAV header data_size for IEEE float32 (was 16-bit byte count)
- finishWav call sites accumulated n*4 (stereo 16-bit) but float32 writer emits n*8 bytes -> RIFF/data chunk sizes half the real value; players and soundfile truncated renders to half length - gate test now asserts file size == 44 + data_size to catch this
This commit is contained in:
@@ -881,7 +881,7 @@ int run_render_fx_job(const std::string& jobPath, const std::string& inPath,
|
||||
for (uint64_t pos = 0; pos < in.L.size(); pos += chunk) {
|
||||
const uint32_t n = (uint32_t)std::min<uint64_t>(chunk, in.L.size() - pos);
|
||||
writeFrames(wav, in.L.data() + pos, in.R.data() + pos, n);
|
||||
dataBytes += (uint64_t)n * 4;
|
||||
dataBytes += (uint64_t)n * 8; // stereo float32: 2ch * 4B
|
||||
}
|
||||
finishWav(wav, dataBytes);
|
||||
wav.close();
|
||||
|
||||
Reference in New Issue
Block a user