Skip to content

core.signal

audio_extensions

fastaudio.core.signal.audio_extensions

List of extensions suitable for audio files

get_audio_files

fastaudio.core.signal.get_audio_files(path, recurse=True, folders=None)

Get audio files in path recursively, only in folders, if specified.

AudioGetter

fastaudio.core.signal.AudioGetter(suf='', recurse=True, folders=None)

Create get_audio_files partial function that searches path suffix suf and passes along kwargs, only in folders, if specified.

tar_extract_at_filename

fastaudio.core.signal.tar_extract_at_filename(fname, dest)

Extract fname to dest/fname.name folder using tarfile

AudioTensor

class fastaudio.core.signal.AudioTensor(x, sr=None, **kwargs)

Semantic torch tensor that represents an audio. Contains all of the functionality of a normal tensor, but additionally can be created from files and has extra properties. Also knows how to show itself.

create(fn, cache_folder=None, frame_offset=0, num_frames=-1, normalize=True, channels_first=True, format=None, **kwargs)

Creates audio tensor from file

nsamples
nchannels
duration
hear(self)

Listen to audio clip. Creates a html player.

show(self, ctx=None, hear=True, **kwargs)

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

OpenAudio

class fastaudio.core.signal.OpenAudio(self, items)

Transform that creates AudioTensors from a list of files.