Audio Player¶
- modusa.play(y: ndarray, sr: float, t0: float = 0.0, regions=None, title=None) None [source]¶
Plays audio clips for given regions in Jupyter Notebooks.
- Parameters:
y (np.ndarray) –
Audio data.
Mono (1D) numpy array.
sr (float) –
Sampling rate of the audio.
t0 (float) –
Starting timestamp, incase the audio is cropped
Default: 0.0 → Starts from 0.0 sec
regions (list[tuple[float, float, str]] | tuple[float, float, str] | None) –
Regions to extract and play (in sec), e.g. [(0, 10.2, “tag”)]
If there is only one region, a tuple should also work. e.g. (0, 10.2, “tag”)
Default: None → The entire song is selected.
title (str | None) –
Title to display above audio players.
- Return type:
None