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[source]

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[source]

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

TensorAudio.hear[source]

TensorAudio.hear()

Listen to audio clip. Creates a html player.

TensorAudio.show[source]

TensorAudio.show(ctx=None, hear=True, ax=None, title='', sep=0.03)

Show audio clip using librosa. Pass hear=True to also display a html player to listen.

TensorAudio.save[source]

TensorAudio.save(fn:Path, overwrite=True)

Save the audio into the specfied path

show_spectrogram[source]

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[source]

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

Create an TensorSpec from a torch tensor

TensorSpec.show[source]

TensorSpec.show(ctx=None, 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[source]

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

Create an TensorMelSpec from a torch tensor