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
)
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
TensorAudio.hear
()
Listen to audio clip. Creates a html player.
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
(fn
:Path
, overwrite
=True
)
Save the audio into the specfied path
show_spectrogram
(aspec
, title
=''
, ax
=None
, ctx
=None
, sep
=0.025
, to_db
=False
, **kwargs
)
TensorSpec
(x
, **kwargs
) :: TensorImageBase
Tensor for Audio Spectrograms. Has extra properties and knows how to show itself.
TensorSpec.create
(ta
:Tensor
, settings
:dict | None
=None
)
Create an TensorSpec from a torch tensor
TensorSpec.show
(ctx
=None
, ax
=None
, title
=''
, sep
=0.025
, to_db
=False
)
Show spectrogram using librosa
TensorMelSpec
(x
, **kwargs
) :: TensorSpec
Tensor for Audio MelSpectrograms. Has extra properties and knows how to show itself.
TensorMelSpec.create
(ta
:Tensor
, settings
:dict | None
=None
)
Create an TensorMelSpec from a torch tensor