AudioMatch

Read-only audio match result. Score is similarity, not an accuracy probability. find() timestamps use the listening session timeline; match() uses the searched audio value's timeline. Compare timestamps to avoid handling one sound repeatedly. Only use timestamps as detections when matched is True.

Syntax

AudioMatch

This class cannot be constructed directly.

Returns

—

Example

# Save the alert sample in Template Manager before running
sample = Audio("alert")
Audio.start()
wait(1500)
clip = Audio.recent(1500)
result = clip.match(sample, 0.85)
print(result.matched, result.score, result.start_ms, result.end_ms)
Audio.stop()

Fields

NameDescription
matchedBoolean
True when a non-silent candidate meets the threshold.
scoreNumber
Similarity from 0 to 1, not a probability.
start_msNumber
Candidate start time in milliseconds on the searched audio timeline.
end_msNumber
Exclusive end time in milliseconds on the same timeline as start_ms.