Audio Core

Basic audio opening, processing, and displaying functionality

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


source

show_audio_signal

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

source

TensorAudio

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

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


source

TensorAudio.create

 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


source

TensorAudio.hear

 TensorAudio.hear ()

Listen to audio clip. Creates a html player.


source

TensorAudio.show

 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.


source

TensorAudio.save

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

Save the audio into the specfied path


source

show_spectrogram

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

source

TensorSpec

 TensorSpec (x, **kwargs)

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.


source

TensorSpec.create

 TensorSpec.create (ta:torch.Tensor, settings:Optional[dict]=None)

Create an TensorSpec from a torch tensor


source

TensorSpec.show

 TensorSpec.show (ctx=None, ax=None, title='', sep=0.025, to_db=False)

Show spectrogram using librosa


source

TensorMelSpec

 TensorMelSpec (x, **kwargs)

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.


source

TensorMelSpec.create

 TensorMelSpec.create (ta:torch.Tensor, settings:Optional[dict]=None)

Create an TensorMelSpec from a torch tensor