Skip to content

Video editing with Python

fix typo that introduces audio regression This should fix #891.

chrox119307692dae
diff --git a/moviepy/audio/io/readers.py b/moviepy/audio/io/readers.py
index 9f28639e..de338fbf 100644
--- a/moviepy/audio/io/readers.py
+++ b/moviepy/audio/io/readers.py
@@ -114,9 +114,9 @@ class FFMPEG_AudioReader:
s = self.proc.stdout.read(L)
dt = {1: 'int8',2:'int16',4:'int32'}[self.nbytes]
if hasattr(np, 'frombuffer'):
- result = np.frombuffer(s, dtype='uint8')
+ result = np.frombuffer(s, dtype=dt)
else:
- result = np.fromstring(s, dtype='uint8')
+ result = np.fromstring(s, dtype=dt)
result = (1.0*result / 2**(8*self.nbytes-1)).\
reshape((int(len(result)/self.nchannels),
self.nchannels))