From 77b29ce5ee07e3385c9d2f5578a9b9ba532a5b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20F?= Date: Mon, 17 May 2021 21:05:37 +0200 Subject: [PATCH] Fix Stereo PCM Extraction Extracting Stereo PCM allocation need to use `sample.channels`. Otherwise, only Mono PCM works, or only the first half of the Stero PCM got written. --- fsb5/pcm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsb5/pcm.py b/fsb5/pcm.py index 5d4cd1e..865e0c2 100644 --- a/fsb5/pcm.py +++ b/fsb5/pcm.py @@ -3,7 +3,7 @@ def rebuild(sample, width): - data = sample.data[:sample.samples * width] + data = sample.data[:sample.samples * sample.channels * width] ret = BytesIO() with wave.open(ret, "wb") as wav: wav.setparams((sample.channels, width, sample.frequency, 0, "NONE", "NONE"))