Contents

MLSoundClassifier.DataSource.labeledFiles(at:)

Creates a data source from a folder that contains audio files, each named after the sound they represent.

Declaration

case labeledFiles(at: URL)

Parameters

  • at:

    URL: The URL to a folder in the file system that contains audio files. The data source uses the first component of each audio file’s name as its classification label.

Discussion

Create a sound classifier data source from a directory of audio files with the labeledFiles case. You must name each file with a sound classification label, followed by a period and an arbitrary string, ending with the file extension. For example, you can name a sound classifier’s training files as Laughter.3.png, Applause.1.jpg, Applause.2.jpg, and so on.

In this example, these audio file names give a sound classifier at least two class labels:

  • Laughter

  • Applause

See Also

Creating a data source