Create custom audio experiences with ShazamKit

RSS for tag

Discuss the WWDC21 session Create custom audio experiences with ShazamKit.

View Session

Posts under wwdc21-10045 tag

11 Posts
Sort by:
Post not yet marked as solved
0 Replies
484 Views
Hi all, I have an app that is playing music from http live streams using AVPlayer. Have been trying to figure out how to use ShazamKit to recognise the music playing but I just can't figure out how to do it :-( Works well with local files and microphone recordings, but how do I get the data from a stream that is currently playing??? Feels like I tried everything... Have tried to install an MTAudioProcessingTap but it doesn't seem to work on streaming assets even though I can get hold of the proper AVAssetTrack containing the audio. No callback with data are received? Bug? I can open the streaming url and just save the bytes to disk and that's fine, but I'm not in sync with what is playing in AVPlayerItem so the recognition isn't working with the same audio data as the user is currently hearing. Hmmm. Any suggestions and ideas are welcome. It would be such a nice feature for my app so I'm really looking forward to solving this. Thx in advance / Jörgen, Bitfield
Posted
by
Post not yet marked as solved
0 Replies
388 Views
Hello Team, Hope you are doing well..!! I am developing a music recognition app by using ShazamKit. I get a MATCH_ATTEMPT_FAILED error every time. So Please let me know how I can fix this issue? Error Log:- Error(exception=com.shazam.shazamkit.ShazamKitMatchException: MATCH_ATTEMPT_FAILED, querySignature=Signature(dataRepresentation=[-128, 37, -128, 37, 1, 0, 0, 0, 12, 0, 0, 0, -128, 37, -2, -54, -100, -90, 21, 112, -36, 1, 0, 0, 0, -100, 32, -108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 56, 32, 1, 0, 0, 0, 124, 0, 0, 0, 0, 64, -36, 1, 0, 0, 64, 0, 3, 96, 75, 0, 0, 0, 16, -9, 110, 107, 15, 13, -124, 110, -118, 11, 5, -63, 109, 124, 10, 15, 101, 113, 57, 13, 6, 63, 108, 119, 8, 0, 88, 112, -68, 12, 10, -103, 110, -93, 14, 9, -79, 109, 71, 16, 8, 5, 111, -9, 9, 11, 85, 110, 120, 15, 3, -96, 112, 60, 9, 13, -113, 110, -16, 10, 15, 103, 111, 58, 8, 18, 28, 110, -17, 15, 14, -46, 112, 65, 14, 0, 65, 0, 3, 96, 120, 0, 0, 0, 27, 40, 112, 56, 30, 3, -111, 112, 77, 21, 6, -6, 110, -71, 31, 4, 21, 120, -1, 25, 5, 4, 111, -77, 40, 2, 82, 111, 85, 23, 14, 26, 111, -128, 19, 6, 14, 111, 0, 29, 1, -54, 109, 85, 42, 0, 95, 111, 39, 46, 3, 63, 113, -106, 32, 3, 6, 112, 117, 39, 14, -32, 119, 16, 26, 6, 38, 113, -64, 29, 7, -3, 110, 48, 17, 8, 5, 111, -62, 31, 1, 108, 110, 71, 37, 5, -67, 109, 64, 31, 4, 22, 111, 110, 22, 7, -41, 110, 63, 42, 2, 3, 111, -22, 22, 13, -43, 110, -65, 34, 11, -105, 110, -18, 17, 4, 39, 110, 84, 43, 66, 0, 3, 96, 120, 0, 0, 0, 14, -110, 111, 15, 67, 6, 29, 112, -117, 65, 3, -15, 119, 20, 78, 4, -17, 111, 24, 52, 2, 64, 113, -8, 83, 13, 41, 113, -73, 71, 4, -56, 113, -107, 103, 11, -1, 111, -102, 73, 5, -4, 111, 112, 96, 2, -123, 114, -57, 50, 8, 101, 112, 52, 72, 6, -121, 112, 7, 83, 16, -34, 111, -43, 65, 0, 124, 120, 19, 78, 1, -34, 111, -119, 70, 6, -123, 113, -54, 108, 17, 106, 111, -56, 84, 4, -43, 111, 68, 69, 6, 96, 111, -62, 55, 6, -78, 111, -48, 111, 9, 99, 112, -6, 102, 1, 74, 113, 18, 58, 5, -8, 111, -3, 96, 1, 8, 113, 94, 104, 67, 0, 3, 96, 120, 0, 0, 0, 19, 19, 112, 49, -122, 2, -128, 111, -64, 116, 5, -77, 112, -81, -90, 1, 110, 113, -20, -96, 4, 81, 113, -56, -111, 23, -57, 111, -109, -82, 3, 110, 111, -11, -122, 6, 8, 112, -38, 112, 15, 17, 113, -6, -81, 2, -72, 111, -2, 125, 15, -46, 111, 13, -110, 1, 100, 111, -106, 113, 3, 83, 119, 49, -126, 0, -87, 113, -64, -84, 3, 29, 112, -74, -110, 5, -86, 111, -125, 124, 5, 58, 112, 123, -109, 1, 54, 112, 66, 122, 5, 72, 111, -99, -94, 23, -96, 112, -17, -92, 3, 31, 113, 44, -101, 4, 54, 112, -84, -96, 4, -69, 112, 52, -100, 3, 66, 111, -14, -110], durationInMs=1297, audioStartTimestamp=b.a.a.a.d@9c5d28e0))
Posted
by
Post not yet marked as solved
1 Replies
486 Views
so i'm learning how to work with ShazamKit on xcode 13 beta 4 and while i'm trying to watch this video https://www.youtube.com/watch?v=KvyQvZYqGL0&list=PL5PR3UyfTWveeb0iCmauh7boDnpCmpMed at 2:33 - the dude said that i need to enable Shazam service if i want ShazamKit to work properly. where do i need to go? how do i find this page?
Posted
by
Post not yet marked as solved
1 Replies
725 Views
I'm creating a simple song-matching application. My steps are: I create a project in XCode. Set bundle ID. Select my team Create an identifier, in my developer account Inserting my bundle ID from Xcode Selecting my team's application ID Turn on ShazamKit in services And after all that, I still get 202 error Error Domain=com.apple.ShazamKit Code=202 "Please check that you have enabled the ShazamKit App Service for this app identifier" UserInfo={NSDebugDescription=Please check that you have enabled the ShazamKit App Service for this app identifier} What am I doing wrong? Could it have something to do with the code?
Posted
by
Post not yet marked as solved
2 Replies
803 Views
In continuation to this question, I am now able to use ShazamKit in my app, but for every video I pass to it didFailWithSignature is always called: func session(_ session: SHSession,        didNotFindMatchFor signature: SHSignature,                  error: Error?) {         DispatchQueue.main.async {             print("match error: \(String(describing: error))")         }     } with the following output: match error: nil This is happening even with videos that are just screen recorded video clips of Ed Sheeran for example, something that Shazam would easily recognized. Any idea why that would happen? What I should investigate? (the full code is also updated on my GitHub
Posted
by
Post not yet marked as solved
1 Replies
593 Views
The operation couldn’t be completed. (com.apple.ShazamKit error 300.) I get this error when I try to add multiple shazamcatalogs on a single SHCustomCatalog. The fact that the operation is called add(from:) and not 'load' lets me suggest that it's meant to use that way. Am I wrong? And yes, both work work if I just add one at a time. let catalog = SHCustomCatalog() do { try catalog.add(from: url1) try catalog.add(from: url2) {...} } catch {...} . . Also, fun fact: I was working on a ShazamKit myself before dubDub and it's a really fascinating topic and so awesome to see how well it works, great job! 👏
Post marked as solved
3 Replies
854 Views
I was trying to generate a signature from an audio file on-disk. Loading the files work, however generating signatures from them don't seem to work. Here's the code I'm using to generate the signature: func signature(from asset: AVAudioFile) -> SHSignature? {     let format = asset.processingFormat     let frameCount = AVAudioFrameCount(asset.length)           guard let buffer = AVAudioPCMBuffer(pcmFormat: format, frameCapacity: frameCount) else { return nil }     let generator = SHSignatureGenerator()           do {        try asset.read(into: buffer)                let sampleRate = asset.processingFormat.sampleRate                try generator.append(buffer, at: AVAudioTime(sampleTime: .zero, atRate: sampleRate))                return generator.signature()     } catch {        print(error)        return nil     } } There are no errors being thrown in the code, but when I try to use the signatures in an SHSession, the audio is not being recognised. However, using the Shazam library works. I have tried searching ways to do this, however the only examples I've seen are for generating signatures from live audio input. Is there something I'm missing from the code above?
Posted
by
Post marked as solved
5 Replies
1.6k Views
I want to create my own custom audio recognition with ShazamKit, when opening the sample project I found the FoodMath.shazamsignature file. I believe there is a way to generate that file based on my audio collections. How do I create the .shazamsignature file? Thanks.
Posted
by