Audio Core
Audio Core is heavily inspired by and contains code from the no longer maintained FastAudio package.
show_audio_signal
show_audio_signal (at, ctx, ax=None, title='', sep=0.03, **kwargs)
TensorAudio
TensorAudio (x, sr=None, **kwargs)
Tensor for audio. Can be created from files and has extra properties. Also knows how to show itself.
TensorAudio.create
TensorAudio.create (fn:Union[str,pathlib.Path,BinaryIO], **kwargs)
Creates TensorAudio
from file fn
TensorAudio.hear
TensorAudio.hear ()
Listen to audio clip. Creates a html player.
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.
TensorAudio.save
TensorAudio.save (fn:pathlib.Path, overwrite=True)
Save the audio into the specfied path
show_spectrogram
show_spectrogram (aspec, title='', ax=None, ctx=None, sep=0.025, to_db=False, **kwargs)
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.
TensorSpec.create
TensorSpec.create (ta:torch.Tensor, settings:Optional[dict]=None)
Create an TensorSpec from a torch tensor
TensorSpec.show
TensorSpec.show (ctx=None, ax=None, title='', sep=0.025, to_db=False)
Show spectrogram using librosa
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.
TensorMelSpec.create
TensorMelSpec.create (ta:torch.Tensor, settings:Optional[dict]=None)
Create an TensorMelSpec from a torch tensor