Basic audio opening, processing, and displaying functionality

Audio Core is heavily inspired by and contains code from the no longer maintained FastAudio package.


show_audio_signal(at, ctx, ax=None, title='', sep=0.03, **kwargs)

class TensorAudio[source]

TensorAudio(x, sr=None, **kwargs) :: TensorBase

Tensor for audio. Can be created from files and has extra properties. Also knows how to show itself.


TensorAudio.create(fn, frame_offset:int=0, num_frames:int=-1, normalize:bool=True, channels_first:bool=True, format:Optional[str]=None, **kwargs)

Creates TensorAudio from file fn



Listen to audio clip. Creates a html player.[source], hear=True, ax=None, title='', sep=0.03)

Show audio clip using librosa. Pass hear=True to also display a html player to listen.[source], overwrite=True)

Save the audio into the specfied path


show_spectrogram(aspec, title='', ax=None, ctx=None, sep=0.025, to_db=False, **kwargs)

class TensorSpec[source]

TensorSpec(x, **kwargs) :: TensorImageBase

Tensor for Audio Spectrograms. Has extra properties and knows how to show itself.

The best way to create a TensorSpec is to use the Spectrogram transform or SpecBlock which uses the Spectrogram transform.


TensorSpec.create(ta:Tensor, settings:dict | None=None)

Create an TensorSpec from a torch tensor[source], ax=None, title='', sep=0.025, to_db=False)

Show spectrogram using librosa

class TensorMelSpec[source]

TensorMelSpec(x, **kwargs) :: TensorSpec

Tensor for Audio MelSpectrograms. Has extra properties and knows how to show itself.

The best way to create a TensorMelSpec is to use the MelSpectrogram transform or MelSpecBlock which uses the MelSpectrogram transform.


TensorMelSpec.create(ta:Tensor, settings:dict | None=None)

Create an TensorMelSpec from a torch tensor