Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

axiom-shazamkit-refAxiom Shazamkit 参考

Agent Skill

axiom-shazamkit-ref 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

396

周安装

17

GitHub Stars

873

下载量

139
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:axiom-shazamkit-ref(Axiom Shazamkit 参考)
来源仓库:https://github.com/charleswiltgen/axiom
仓库路径:skills/axiom-shazamkit-ref
安装命令:
npx skills add https://github.com/charleswiltgen/axiom --skill axiom-shazamkit-ref
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/charleswiltgen/axiom --skill axiom-shazamkit-ref

简介

提供 ShazamKit 的完整 API 参考,涵盖音乐与自定义音频识别接口。

  • 适用于需要查询匹配、签名生成、目录管理或库集成细节的开发任务。
  • 按功能模块组织 API,支持 iOS 15+ 全平台及 visionOS 1+ 扩展。
  • 安装前建议确认权限范围和维护状态,避免触发联网或文件读写操作。
  • axiom-shazamkit-ref 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

ShazamKit API Reference

Overview

ShazamKit provides audio recognition against Shazam's music catalog and custom audio catalogs. The framework covers matching, signature generation, catalog management, and library integration.

For decision trees, setup checklist, and best practices, see the shazamkit discipline skill.

Platform: iOS 15+, iPadOS 15+, macOS 12+, tvOS 15+, watchOS 8+, visionOS 1+


Part 1: SHManagedSession (iOS 17+)

A managed session that handles recording and matching captured sound automatically. This is the modern, recommended path for microphone-based recognition.

Initialization

init()                              // Matches against Shazam catalog
init(catalog: SHCatalog)            // Matches against custom catalog

Matching

func result() async -> SHSession.Result           // Single match attempt
var results: SHManagedSession.Results             // AsyncSequence for continuous matching

Lifecycle

func prepare() async                // Preallocate resources + start prerecording
func cancel()                       // Stop recording + cancel current match

State (Observable)

var state: SHManagedSession.State   // Current session state

SHManagedSession conforms to Observable (iOS 17+). SwiftUI views refresh automatically on state changes.

Conforms to Sendable as of iOS 18.


Part 2: SHManagedSession.State

@frozen enum State
CaseMeaning
.idleNot recording or matching
.prerecordingPrepared, recording in anticipation of match
.matchingActively making match attempts

Part 3: SHSession (iOS 15+)

Lower-level session for matching audio buffers or signatures against catalogs.

Initialization

init()                              // Matches against Shazam catalog
init(catalog: SHCatalog)            // Matches against custom catalog

Matching Methods

func match(_ signature: SHSignature)                        // Match a complete signature
func matchStreamingBuffer(_ buffer: AVAudioPCMBuffer, at time: AVAudioTime?)  // Match streaming audio

When using matchStreamingBuffer, include the time parameter when available — the session validates contiguous audio.

Delegate

var delegate: (any SHSessionDelegate)?

AsyncSequence (iOS 16+)

var results: SHSession.Results     // AsyncSequence of SHSession.Result

Audio Format Support

  • iOS 15-16: Specific PCM formats and sample rates required
  • iOS 17+: Most PCM format settings accepted; automatic conversion

Multiple Matches (iOS 17+)

When a query matches multiple reference signatures in a custom catalog, all matches are returned sorted by quality. Use metadata annotation to distinguish between them.


Part 4: SHSession.Result (iOS 16+)

@frozen enum Result: Sendable
CaseAssociated Value
.match(SHMatch)Matched media items found
.noMatch(SHSignature)No match for this signature
.error(any Error, SHSignature)Error during matching

Part 5: SHSessionDelegate (iOS 15+)

protocol SHSessionDelegate: NSObjectProtocol

Methods

optional func session(_ session: SHSession, didFind match: SHMatch)
optional func session(_ session: SHSession, didNotFindMatchFor signature: SHSignature, error: (any Error)?)

Part 6: SHMatch (iOS 15+)

Contains the results of a successful match.

Properties

var mediaItems: [SHMatchedMediaItem]    // Matched items (multiple possible)
var querySignature: SHSignature         // The query that produced this match

Part 7: SHMediaItem (iOS 15+)

Metadata associated with a reference signature.

Initialization

init(properties: [SHMediaItemProperty : any NSSecureCoding & NSObjectProtocol])

Predefined Properties

PropertyTypeDescription
.titleStringSong/content title
.subtitleStringSubtitle
.artistStringArtist name
.artworkURLURLAlbum art URL
.videoURLURLVideo URL
.genres[String]Genre list
.explicitContentBoolExplicit content flag
.isrcStringInternational Standard Recording Code
.appleMusicIDStringApple Music identifier
.appleMusicURLURLApple Music URL
.webURLURLWeb URL for sharing
.shazamIDStringShazam catalog identifier
.creationDateDateWhen item was created

Timed Content Properties (iOS 16+)

PropertyTypeDescription
.timeRanges[Range<TimeInterval>]When this item is active in the reference
.frequencySkewRanges[Range<Float>]Frequency skew ranges for differentiation

Custom Properties

Add custom metadata using SHMediaItemProperty extensions:

extension SHMediaItemProperty {
    static let episodeNumber = SHMediaItemProperty("episodeNumber")
    static let teacher = SHMediaItemProperty("teacher")
}

let item = SHMediaItem(properties: [
    .title: "Episode 3",
    .episodeNumber: 3,
    .teacher: "Neil"
])

Custom property values must be valid property list types.

Fetching by Shazam ID

class func fetch(shazamID: String, completionHandler: @escaping (SHMediaItem?, (any Error)?) -> Void)

Requests a media item from the Shazam catalog by its Shazam ID.

Subscript Access

subscript(key: SHMediaItemProperty) -> Any { get }

Protocols

NSSecureCoding, NSCopying, NSObjectProtocol, Identifiable (iOS 17+), Sendable


Part 8: SHMatchedMediaItem (iOS 15+)

Subclass of SHMediaItem with match-specific information. Only created by the framework from successful matches.

Additional Properties

PropertyTypeDescription
.matchOffsetTimeIntervalWhere in the reference the match occurred
.predictedCurrentMatchOffsetTimeIntervalAuto-updating position in reference (seconds)
.frequencySkewFloatFrequency difference between matched and reference
.confidenceFloatMatch confidence (0.0 to 1.0, where 1.0 is highest)

predictedCurrentMatchOffset updates continuously during streaming matches — use it to sync UI to audio position.


Part 9: SHMediaItemProperty (iOS 15+)

struct SHMediaItemProperty: RawRepresentable, Hashable, Sendable

Predefined property keys for SHMediaItem. Extend with custom keys using init(rawValue:).

All Predefined Keys

.title, .subtitle, .artist, .artworkURL, .videoURL, .genres, .explicitContent, .isrc, .appleMusicID, .appleMusicURL, .webURL, .shazamID, .creationDate, .matchOffset, .frequencySkew, .confidence, .timeRanges, .frequencySkewRanges


Part 10: SHSignature (iOS 15+)

Contains opaque audio fingerprint data.

Properties

var duration: TimeInterval          // Duration of audio represented
var dataRepresentation: Data        // Serializable data for storage/transmission

Initialization

init(dataRepresentation: Data) throws

Slicing

func slices(from start: TimeInterval, duration: TimeInterval, stride: TimeInterval) -> SHSignature.Slices

Returns a sequence of signature segments of the specified duration, stepping by stride from the start offset.

Protocols

NSSecureCoding, NSCopying, NSObjectProtocol, Sendable


Part 11: SHSignatureGenerator (iOS 15+)

Converts audio into signatures.

From Buffers

func append(_ buffer: AVAudioPCMBuffer, at time: AVAudioTime?) throws
func signature() -> SHSignature

From Asset (iOS 16+)

static func signature(from asset: AVAsset) async throws -> SHSignature

Accepts any AVAsset with an audio track. Multiple tracks are mixed automatically.


Part 12: SHCatalog (iOS 15+)

Abstract base class for catalogs.

Properties

var minimumQuerySignatureDuration: TimeInterval  // Minimum query length needed
var maximumQuerySignatureDuration: TimeInterval  // Maximum useful query length

Part 13: SHCustomCatalog (iOS 15+)

Mutable catalog for custom audio matching.

Adding Content

func addReferenceSignature(_ signature: SHSignature, representing mediaItems: [SHMediaItem]) throws

Persistence

func write(to url: URL) throws                  // Save .shazamcatalog file
func add(from url: URL) throws                   // Load/merge from file

File extension: .shazamcatalog

Protocols

Sendable


Part 14: SHLibrary (iOS 17+)

User's synced Shazam library. Each app can only read and delete items it has added.

Access

static var `default`: SHLibrary

Methods

func addItems(_ items: [SHMediaItem]) async throws
func removeItems(_ items: [SHMediaItem]) async throws
var items: [SHMediaItem] { get }                    // Observable

Reading Current Items (Non-UI)

let currentItems = await SHLibrary.default.items

Observable

Conforms to Observable. SwiftUI views using SHLibrary.default.items update automatically when items change.

Sync

Items sync across devices via iCloud. Attributed to the app that added them. Visible in Shazam app and Control Center Music Recognition module.


Part 15: SHMediaLibrary (iOS 15+, Legacy)

Legacy write-only access to the user's Shazam library.

Access

static var `default`: SHMediaLibrary

Methods

func add(_ mediaItems: [SHMediaItem], completionHandler: @escaping (Error?) -> Void)

Constraints

  • Write-only (no read, no delete)
  • Only accepts items with valid Shazam catalog IDs
  • End-to-end encrypted, requires two-factor authentication
  • No special permission required

Part 16: SHError

struct SHError: Error

Error Codes (SHError.Code)

Matching Errors

CodeDescription
.matchAttemptFailedMatch attempt failed
.signatureInvalidInvalid signature data

Catalog Errors

CodeDescription
.customCatalogInvalidCatalog data is corrupt or invalid
.customCatalogInvalidURLURL for catalog is invalid

Signature Errors

CodeDescription
.signatureDurationInvalidSignature duration too short or long
.audioDiscontinuityGap detected in streaming audio

Media Library Errors

CodeDescription
.mediaLibrarySyncFailedFailed to sync with library
.internalErrorInternal framework error

Session Errors

CodeDescription
.invalidAudioFormatAudio format not supported
.mediaItemFetchFailedFailed to fetch media item details

Part 17: Shazam CLI (macOS 13+)

Command-line tool for building custom catalogs at scale.

Commands

# Create signature from media file
shazam signature --input <media-file> --output <signature-file>

# Create custom catalog
shazam custom-catalog create \
    --input <signature-file> \
    --media-items <csv-file> \
    --output <catalog-file>

# Update existing catalog
shazam custom-catalog update \
    --input <signature-file> \
    --media-items <csv-file> \
    --catalog <catalog-file>

# Display catalog contents
shazam custom-catalog display --catalog <catalog-file>

# Add/remove/export signatures and media items
shazam custom-catalog add ...
shazam custom-catalog remove ...
shazam custom-catalog export ...

Run shazam custom-catalog create --help for CSV header-to-property mapping.


Part 18: Sample Projects

Building a Custom Catalog and Matching Audio

FoodMath educational app demonstrating custom catalog matching with synced UI content. Uses SHSession with delegate pattern.

Key patterns: Custom SHMediaItemProperty extensions, predictedCurrentMatchOffset for time-sync, SHCustomCatalog from .shazamsignature files.

ShazamKit Dance Finder with Managed Session

Dance discovery app using SHManagedSession for simplified matching. Demonstrates SHLibrary read/write/delete and Observable SwiftUI integration.

Key patterns: SHManagedSession result/results, session state in SwiftUI, SHLibrary.default.items in List, swipe-to-delete with removeItems.


Quick Reference

Class Hierarchy

SHCatalog (abstract)
├── SHCustomCatalog (mutable, user-created)
└── (internal Shazam catalog)

SHMediaItem
└── SHMatchedMediaItem (match-specific subclass)

SHSession         → delegate or AsyncSequence
SHManagedSession  → AsyncSequence, Observable, handles recording

Common Patterns

TaskAPI
Identify song (iOS 17+)SHManagedSession().result()
Continuous recognitionfor await result in session.results
Match custom audioSHManagedSession(catalog: custom)
Match signature fileSHSession().match(signature)
Generate from fileSHSignatureGenerator.signature(from: asset)
Generate from micgenerator.append(buffer, at: time)
Add to librarySHLibrary.default.addItems([item])
Read librarySHLibrary.default.items
Remove from librarySHLibrary.default.removeItems([item])

File Extensions

ExtensionPurpose
.shazamsignatureAudio signature file
.shazamcatalogCustom catalog file

Resources

WWDC: 2021-10044, 2021-10045, 2022-10028, 2023-10051

Docs: /shazamkit, /shazamkit/shmanagedsession, /shazamkit/shsession, /shazamkit/shcustomcatalog, /shazamkit/shmediaitem, /shazamkit/shlibrary

Skills: shazamkit, avfoundation-ref, swift-concurrency

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.62%
按下载量换算47

Claude

30.82%
按下载量换算43

Cursor

20.49%
按下载量换算28

Gemini CLI

9.61%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills