Usage
Signature
Parameters
A path or URL to an audio
file, bytes, or a file-like object opened in binary mode, 1D numpy array → Mono waveform, 2D numpy array → Multi-channel waveform (Shape: [NCHAN, NSAMPLES]).Sampling rate (required only for NumPy arrays).
Whether to rescale NumPy array audio to its max range (
True by default). If False, values must be in [-1, 1], or an error is raised. Does not apply to non-array audio sources.Returns
Html
An audio player as an
Html object.Supported Input Types
Thesrc parameter accepts:
str: Path or URL to an audio filebytes: Audio data as bytesio.BytesIO: File-like object in binary modeio.BufferedReader: Buffered file readernumpy.ndarray: 1D array for mono or 2D array for multi-channel audio
- 1D array: Mono waveform
- 2D array: Multi-channel waveform with shape
[NCHAN, NSAMPLES] - You must specify the
rateparameter when using numpy arrays