turicreate.load_audio

turicreate.load_audio(path, with_path=True, recursive=True, ignore_failure=True, random_order=False)

Loads WAV file(s) from a path.

Parameters:
path : str

Path to WAV files to be loaded.

with_path : bool, optional

Indicates whether a path column is added to the returned SFrame.

recursive : bool, optional

Indicates whether load_audio should do a recursive directory traversal, or only load audio files directly under path.

ignore_failure : bool, optional

If True, only print warnings for failed files and keep loading the remaining audio files.

random_order : bool, optional

Load audio files in random order.

Returns:
out : SFrame

Returns an SFrame with either an ‘audio’ column or both an ‘audio’ and a ‘path’ column. The ‘audio’ column is a column of dictionaries.

Each dictionary contains two items. One item is the sample rate, in samples per second (int type). The other item will be the data in a numpy array. If the wav file has a single channel, the array will have a single dimension. If there are multiple channels, the array will have shape (L,C) where L is the number of samples and C is the number of channels.

Examples

>>> audio_path = "~/Documents/myAudioFiles/"
>>> audio_sframe = tc.audio_analysis.load_audio(audio_path, recursive=True)