Contents

SHManagedSession

An object that records and matches a recording with captured sound in the Shazam catalog or your custom catalog.

Declaration

final class SHManagedSession

Overview

This session is an alternative for SHSession if you prefer ShazamKit to manage recording.

There are two main differences between this managed session and the SHSession:

Matching songs in Shazam requires enabling your app to access the catalog. For more information on enabling your app, see Enable ShazamKit for an App ID.

The code below shows searching for a match in the Shazam catalog using SHManagedSession:

// Set up the session.
let session = SHManagedSession()

// Check for a match.
let result = await session.result()

// Use the result.
switch result {
  case .match(let match):
       // Match found.
  case .noMatch(let signature):
       // No match found.
  case .error(let error, let signature):
       // An error occurred.
}

Topics

Creating a managed session object

Getting the session state

Returning queries

See Also

Match audio