librosa.util.buf_to_int¶
-
librosa.util.
buf_to_int
(x, n_bytes=2)[source]¶ Convert a floating point buffer into integer values. This is primarily useful as an intermediate step in wav output.
Parameters: x : np.ndarray [dtype=float]
Floating point data buffer
n_bytes : int [1, 2, 4]
Number of bytes per output sample
Returns: x_int : np.ndarray [dtype=int]
The original buffer cast to integer type.
See also