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:
2026-08-18 17:35:54 +07:00
parent 351ee56080
commit ba9ceeea90
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -388,7 +388,7 @@ int run_render_job(const std::string& jobPath, const std::string& outPath) {
const uint32_t n = (uint32_t)(to - from);
mgr.renderAll(L.data(), R.data(), n);
writeFrames(wav, L.data(), R.data(), n);
dataBytes += (uint64_t)n * 4;
dataBytes += (uint64_t)n * 8; // stereo float32: 2ch * 4B
};
while (pos < totalNeeded) {
const uint64_t chunkEnd = std::min(pos + chunk, (uint64_t)totalNeeded);