AudioPlayer

class modusa.tools.audio_player.AudioPlayer[source]

Bases: ModusaTool

Provides audio player in the jupyter notebook environment.

static play(y: ndarray, sr: int, regions: list[tuple[float, float]] | None = None, title: str | None = None) None[source]

Plays audio clips for given regions in Jupyter Notebooks.

Parameters:
  • y (np.ndarray) – Audio time series.

  • sr (int) – Sampling rate.

  • regions (list of (float, float), optional) – Regions to extract and play (in seconds).

  • title (str, optional) – Title to display above audio players.

Return type:

None