You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The two steps conversion of audio data to numpy array seems buggy to me.
It should take into account (and afaik it does not) that the most significant bit of every second byte has negative weight (i.e. the numeric representation is in two's complement).
Perhaps a good starting point is to use this one step conversion data_np = np.frombuffer(data_inp, dtype='<i2')
which lands in the range [-32768..+32767] and add an offset if desired
The text was updated successfully, but these errors were encountered:
The two steps conversion of audio data to numpy array seems buggy to me.
It should take into account (and afaik it does not) that the most significant bit of every second byte has negative weight (i.e. the numeric representation is in two's complement).
Perhaps a good starting point is to use this one step conversion
data_np = np.frombuffer(data_inp, dtype='<i2')
which lands in the range [-32768..+32767] and add an offset if desired
The text was updated successfully, but these errors were encountered: