({{, (RefLink[AudioAnnotationLookup, paclet:ref/AudioAnnotationLookup])[audio]
gives all annotations associated to audio.}, {, (RefLink[AudioAnnotationLookup, paclet:ref/AudioAnnotationLookup])[audio,tags] 
gives the annotations specified by tags.}, {, (RefLink[AudioAnnotationLookup, paclet:ref/AudioAnnotationLookup])[audio,tags->selector]
gives a selection of annotation using selector.}, {, (RefLink[AudioAnnotationLookup, paclet:ref/AudioAnnotationLookup])[audio,tags->selector,format]
formats each annotation element according to format.}})

OpenersNotesSection(Spacer1)Details

Annotations are used to store and manipulate annotations for (RefLink[Audio, paclet:ref/Audio]) objects.

(RefLink[AudioAnnotationLookup, paclet:ref/AudioAnnotationLookup]) can be used to select and retrieve annotations at specific locations or based on desired criteria.

Tags specification tags can be any of the following:

The selector can be any of the following:

The arbitrary function f is applied to the association corresponding to each annotation element.

Use (RefLink[AudioAnnotate, paclet:ref/AudioAnnotate]) to automatically compute audio annotations.

OpenersPrimaryExamplesSection(Spacer1)Examples  (8)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Annotate an (RefLink[Audio, paclet:ref/Audio]) object:

a=Import["ExampleData/rule30.wav"];res=AudioAnnotate[a,"tag"->{.5->"val",{1,1.5}->"val2"}];

Retrieve all annotations using (RefLink[AudioAnnotationLookup, paclet:ref/AudioAnnotationLookup]):

AudioAnnotationLookup[res]//Dataset

Annotate an (RefLink[Audio, paclet:ref/Audio]) object:

a=Import["ExampleData/rule30.wav"];res=AudioAnnotate[a,{"tag1"->{.5->"v11",{1,1.5}->"v12"},"tag2"->{.1->"v21",{.7,1.5}->"v22"}}];

Retrieve an annotation with a specific tag:

AudioAnnotationLookup[res,"tag1"]//Dataset

OpenersExampleSection1(Spacer1)Scope  (6)

Annotate an (RefLink[Audio, paclet:ref/Audio]) object:

a=Import["ExampleData/rule30.wav"];a=AudioAnnotate[a,{"Transients","Loud"->(#RMSAmplitude>.08&),"Inaudible"}];

Select all annotations that intersect with the time .2:

AudioAnnotationLookup[a,All->.2]//Dataset

Annotate an (RefLink[Audio, paclet:ref/Audio]) object:

a=Import["ExampleData/rule30.wav"];a=AudioAnnotate[a,{"Transients","Loud"->(#RMSAmplitude>.08&),"Inaudible"}];

Select all annotations between times .1 and 1:

AudioAnnotationLookup[a,All->Interval[{.1,1}]]//Dataset

Select all annotations belonging to the tag "Loud" between times .1 and 1:

AudioAnnotationLookup[a,"Loud"->Interval[{.1,1}]]//Dataset

Annotate an (RefLink[Audio, paclet:ref/Audio]) object:

a=Import["ExampleData/rule30.wav"];a=AudioAnnotate[a,{"Transients","Loud"->(#RMSAmplitude>.08&),"Inaudible"}];

Select all annotations using a custom function:

AudioAnnotationLookup[a,All->(#Value>.4&)]//Dataset

If multiple selection criteria are used, an annotation element is selected if any of them return (RefLink[True, paclet:ref/True]):

a=Import["ExampleData/rule30.wav"];a=AudioAnnotate[a,{"Transients","Loud"->(#RMSAmplitude>.08&),"Inaudible"}];

AudioAnnotationLookup[a,All->{#Time>.6&,#Value>.4&}]//Dataset

Construct a single custom function if other behaviors are needed:

AudioAnnotationLookup[a,All->{#Time>.6&&#Value>.4&}]//Dataset

Annotate an (RefLink[Audio, paclet:ref/Audio]) object:

a=Import["ExampleData/rule30.wav"];a=AudioAnnotate[a,{"Transients","Loud"->(#RMSAmplitude>.08&),"Max"}];

Format the output annotation as a list of intervals:

AudioAnnotationLookup[a,"Transients","Intervals"]

Format the output annotation as a (RefLink[TimeSeries, paclet:ref/TimeSeries]):

AudioAnnotationLookup[a,"Max","TimeSeries"]

Annotate an (RefLink[Audio, paclet:ref/Audio]) object:

a=Import["ExampleData/rule30.wav"];a=AudioAnnotate[a,{"Transients","Loud"->(#RMSAmplitude>.08&),"Max"}];

Format the output annotation using a custom function:

AudioAnnotationLookup[a,"Transients",{#Time,#Duration}&]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[AudioAnnotate, paclet:ref/AudioAnnotate])  ▪  (RefLink[Audio, paclet:ref/Audio])  ▪  (RefLink[AudioLocalMeasurements, paclet:ref/AudioLocalMeasurements])  ▪  (RefLink[MetaInformation, paclet:ref/MetaInformation])  ▪  (RefLink[AudioLabel, paclet:ref/AudioLabel])  ▪  (RefLink[AudioPlot, paclet:ref/AudioPlot])  ▪  (RefLink[AnnotationRules, paclet:ref/AnnotationRules])  ▪  (RefLink[AnnotationDelete, paclet:ref/AnnotationDelete])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Audio Representation, paclet:guide/AudioRepresentation])}})}})