-
Explore ShazamKit
Take advantage of Shazam's exact audio matching capabilities within your app when you use ShazamKit. Learn how you can harness the immense Shazam catalog to create all sorts of experiences, including quickly recognizing the exact song playing in the background of a video captured by your app, offering dynamic visual effects based on the music playing in a room, or even syncing with external audio to provide companion app experiences. We'll also show you how you can build custom catalogs within ShazamKit to match with any audio source — all on device.
For a deeper dive, check out “Create custom audio experiences with ShazamKit,” where you'll code along with us and learn how to build an education app that synchronizes perfectly with streamed video content.Recursos
Videos relacionados
WWDC23
WWDC22
WWDC21
-
Buscar este video…
-
-
9:11 - Matching signatures using SHSession
// Matching signatures using SHSession let session = SHSession() session.delegate = self let signatureGenerator = SHSignatureGenerator() try signatureGenerator.append(buffer, at: nil) let signature = signatureGenerator.signature() session.match(signature) -
10:45 - Receive matches via session delegate
// Receiving matches via the session delegate extension SongResultViewController: SHSessionDelegate { public func session(_ session: SHSession, didFind match: SHMatch) { guard let matchedMediaItem = match.mediaItems.first else { return } DispatchQueue.main.async { self.songView.titleLabel.text = matchedMediaItem.title self.songView.artistLabel.text = matchedMediaItem.artist } } } -
12:24 - Add to Shazam library
// Adding to a customer’s library guard let matchedMediaItem = match.mediaItems.first else { return } SHMediaLibrary.default.add([matchedMediaItem]) { error in if error != nil { // handle the error } }
-