From cb71a3d05debefffef8815e157fd953f317cea3e Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 15 Jun 2014 17:04:29 -0700 Subject: [PATCH] Fix saving audio clips Actually write all of the samples rather than half of them. --- src/command/audio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command/audio.cpp b/src/command/audio.cpp index ae8264dd8..2f8bbe173 100644 --- a/src/command/audio.cpp +++ b/src/command/audio.cpp @@ -235,7 +235,7 @@ struct audio_save_clip final : public Command { size_t spr = 65536 / bytes_per_sample; std::vector buf(bufsize); for (int64_t i = start_sample; i < end_sample; i += spr) { - buf.resize(std::min(spr, end_sample - i)); + buf.resize(std::min(spr, end_sample - i) * bytes_per_sample); provider->GetAudio(&buf[0], i, buf.size()); out.write(buf); }