Load

rythm_forge.load.load(filename: str, mono=True)[source]

Load an audio file and optionally convert it to mono.

Parameters:
  • filename – str Path to the audio file to be loaded. The function currently supports only “.wav” files.

  • mono – bool, optional If True, the loaded audio will be converted to mono. Default is True.

Returns:

np.ndarray Loaded audio data, optionally converted to mono.

Raises:

RythmForgeUnsupportedAudioFormat – If the audio file format is unsupported.

rythm_forge.load.to_mono(y: ndarray) ndarray[source]

Convert a multi-channel audio signal to mono by averaging the channels.

Parameters:

y – np.ndarray Multi-channel audio data.

Returns:

np.ndarray Mono audio data.