Import and Play Audio File Data in Signal Labeler
Use Signal Labeler to
import audio files and labeled signal sets that point to audioDatastore
objects or audio files. Create custom labeling functions to perform automated labeling and
sublabeling tasks. You can also play audio files or signals with time information in the
app.
Note
Importing and playing audio file data in Signal Labeler requires an
Audio Toolbox™ license. For an example on how to create an
audioDatastore
object, see audioDatastore Object Pointing to Audio Files (Audio Toolbox).
Supported Audio File Extensions
When importing audio files, Signal Labeler supports single and multichannel signals with the following audio file extensions:
.wav
.avi
.aif
.aifc
.aiff
.mp3
.au
.snd
.mp4
.m4a
.flac
.ogg
.mov
.opus
Time Information
The audio signals you import into Signal Labeler are automatically labeled in time based on the sample rate information. You cannot import or export audio signals with time information in samples.
Import Audio Signals from Files or Folder
To import signals into Signal Labeler from audio files or a folder
containing audio files, on the Labeler tab, click
Import and select From Audio Files
or From Audio Folder
in the Members
list. In the dialog box, browse to select the audio files or folder that contains the
audio signals you want to import. Each imported audio file is treated as a member of the
labeled signal set. All the signals contained in one audio file belong to a single
member and are labeled together. All members to import must use a file extension listed
in Supported Audio File Extensions.
Note
Importing labeledSignalSet
objects using From
Audio Files
or From Audio Folder
is
not supported. To import a labeledSignalSet
object, load it
into the MATLAB® Workspace and import it from there.
Import labeledSignalSet
from MATLAB Workspace
To import a labeledSignalSet
object into Signal Labeler
from the MATLAB Workspace, on the Labeler tab, click
Import and select From Workspace
in the Members list. In the dialog box, select the
labeledSignalSet
you want to import. Each audio signal in the
labeledSignalSet
is treated as a member of the labeled signal set
and can be labeled individually.
To be imported successfully, labeled signal sets should follow these guidelines:
If the selection includes two or more
labeledSignalSet
objects, each must have unique signal label definitions. If two or more sets share a label definition, the definition must have the same type and data type for all sets. For more information, see Create or Import Signal Label Definitions.If the selection includes two or more
labeledSignalSet
objects, each must have unique member names. You cannot change member names from within Signal Labeler. To change the name of a member of a labeled signal set, usesetMemberNames
at the command line.If you select two or more
labeledSignalSet
objects for labeling, Signal Labeler merges them and creates a single labeled signal set containing all the members and label values of the input sets. This action is equivalent to usingmerge
at the command line.Label values in
labeledSignalSet
objects must be scalars. Signal Labeler ignores those labels which do not have scalar values.
Note
You cannot modify the time information of a
labeledSignalSet
object from within Signal Labeler.Audio labeled signal sets cannot be merged with non-audio labeled signal sets.
Play Audio Signals and Regions of Interest
You can use the Signal Labeler app to play audio signals or other signals
with a constant sample rate in the range [1, 384] kHz. Select the signal you want to
play in the Labeled Signal Set Members browser. On the
Audio tab, select an audio player device from the
Playback Device
list. Click Play
in the Playback section of the toolstrip to play the entire signal
once. Select Play in Loop and then click
Play to play the signal repeatedly. You can also select a
region of interest to play. Select the region in the Labeled Signal Set
Members browser or click on the region directly in the plot, then choose
a playback option to listen to the signal.
Note
Signal Labeler uses audioDeviceWriter
(Audio Toolbox) to play audio. Audio playback is not
supported in MATLAB
Online.
See Also
Apps
Functions
labeledSignalSet
|signalLabelDefinition
|audioDatastore
(Audio Toolbox)
Related Examples
- Label Signal Attributes, Regions of Interest, and Points
- Examine Labeled Signal Set
- Automate Signal Labeling with Custom Functions
- Label Spoken Words in Audio Signals