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

audioaccessorykitaudioaccessorykit 搜索

Agent Skill

用于辅助音频、音乐、语音转写、语音合成或声音素材处理。它适合让 Agent 生成配乐说明、整理音频流程、调用语音工具或处理播客和视频配音素材。使用时需要确认输入音频来源、输出格式、时长和模型限制;涉及人声克隆、版权音乐或公开发布时,应先核对授权和合规边界。

总安装

15,006

周安装

613

GitHub Stars

467

下载量

4,855
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill audioaccessorykit

简介

用于 iOS 26.4+ 系统下第三方音频配件的智能切换与路由管理。

  • 支持配件注册、能力声明和系统级无缝音频输出切换。
  • 依赖 AccessorySetupKit 完成配对后才能启用 AudioAccessoryKit 功能。
  • 安装方式:github,通过 npx skills add 命令从指定仓库添加。
  • 注意:API 可能随 GM 发布变更,依赖前请复查 Apple 官方文档。

SKILL.md

AudioAccessoryKit

Automatic audio switching and intelligent audio routing for third-party audio accessories. Enables companion apps to register audio accessories with the system, report device placement, and declare capabilities so the system can seamlessly switch audio output. Available iOS 26.4+ / Swift 6.3.

Beta-sensitive. AudioAccessoryKit is new in iOS 26.4 and may change before GM. Re-check current Apple documentation before relying on specific API details.

AudioAccessoryKit builds on top of AccessorySetupKit. The accessory must first be paired via AccessorySetupKit before it can be registered for audio features. The central type is AccessoryControlDevice, which manages registration, capability declaration, and ongoing state updates.

Contents

Setup

Prerequisites

  1. Pair the accessory over Bluetooth using AccessorySetupKit. This yields an ASAccessory object.
  2. Import both frameworks in the companion app:
import AccessorySetupKit
import AudioAccessoryKit

Framework Availability

PlatformMinimum Version
iOS26.4+
iPadOS26.4+

Session Management

Registering an Accessory

After pairing via AccessorySetupKit, register the accessory with AccessoryControlDevice by specifying the capabilities it supports:

let accessory: ASAccessory  // Obtained from AccessorySetupKit pairing

let capabilities: AccessoryControlDevice.Capabilities = [.audioSwitching, .placement]
try await AccessoryControlDevice.register(accessory, capabilities)

Registration activates the specified capabilities and tells the system to begin routing audio to the accessory.

Retrieving the Current Configuration

Access the device's current configuration at any time using the static current(for:) method:

let device = try AccessoryControlDevice.current(for: accessory)
let currentConfig = device.configuration

This returns the AccessoryControlDevice instance associated with the paired ASAccessory. The device exposes both the accessory reference and the current configuration.

Updating Configuration

Push configuration changes to the system with update(_:):

let device = try AccessoryControlDevice.current(for: accessory)
var config = device.configuration

config.devicePlacement = .onHead
try await device.update(config)

The update call is async and can throw AccessoryControlDevice.Error on failure.

Audio Switching

Automatic audio switching lets the system intelligently route audio output to the correct device based on placement and connected sources.

Enabling Audio Switching

Declare the .audioSwitching capability during registration:

let capabilities: AccessoryControlDevice.Capabilities = [.audioSwitching]
try await AccessoryControlDevice.register(accessory, capabilities)

For full automatic switching (including placement-based routing), include both capabilities:

let capabilities: AccessoryControlDevice.Capabilities = [.audioSwitching, .placement]
try await AccessoryControlDevice.register(accessory, capabilities)

Capabilities

AccessoryControlDevice.Capabilities is an option set with two members:

CapabilityPurpose
.audioSwitchingDevice supports automatic audio switching
.placementDevice can report its physical placement

Both capabilities can be combined. Audio switching works without placement, but providing placement enables more intelligent routing decisions.

Device Placement

Report the physical position of the accessory to help the system make routing decisions. Update placement whenever the accessory detects a position change.

Placement Values

AccessoryControlDevice.Placement defines four cases:

PlacementMeaning
.inEarAccessory is seated in the ear (e.g., earbuds)
.onHeadAccessory is on the head (e.g., headband headphones)
.overTheEarAccessory is over the ear (e.g., over-ear headphones)
.offHeadAccessory is not being worn

Updating Placement

let device = try AccessoryControlDevice.current(for: accessory)
var config = device.configuration

config.devicePlacement = .inEar
try await device.update(config)

Common transitions:

  • .offHead to .onHead or .inEar when the user puts on the accessory
  • .onHead or .inEar to .offHead when removed
  • Update promptly on every detected change for responsive audio routing

Connected Audio Sources

For accessories that connect to multiple Bluetooth devices simultaneously, inform the system which devices are connected. This lets the system route audio from the appropriate source.

Setting Audio Source Identifiers

Provide the Bluetooth address of connected devices as Data:

let device = try AccessoryControlDevice.current(for: accessory)
var config = device.configuration

let primaryBTAddress = Data([0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC])
config.primaryAudioSourceDeviceIdentifier = primaryBTAddress

let secondaryBTAddress = Data([0xAB, 0xCD, 0xEF, 0x01, 0x23, 0x45])
config.secondaryAudioSourceDeviceIdentifier = secondaryBTAddress

try await device.update(config)

Update these identifiers when the Bluetooth connection state changes (new device connects, existing device disconnects).

Configuration Properties

AccessoryControlDevice.Configuration contains all configurable state:

PropertyTypePurpose
deviceCapabilitiesCapabilitiesDeclared device capabilities
devicePlacementPlacement?Current physical placement
primaryAudioSourceDeviceIdentifierData?Primary connected Bluetooth device address
secondaryAudioSourceDeviceIdentifierData?Secondary connected Bluetooth device address

Feature Discovery

Querying Capabilities

After registration, inspect the device's declared capabilities through its configuration:

let device = try AccessoryControlDevice.current(for: accessory)
let caps = device.configuration.deviceCapabilities

if caps.contains(.audioSwitching) {
    // Device supports automatic audio switching
}

if caps.contains(.placement) {
    // Device reports physical placement
}

Checking Placement

Read the current placement to determine if the accessory is being worn:

let device = try AccessoryControlDevice.current(for: accessory)

if let placement = device.configuration.devicePlacement {
    switch placement {
    case .inEar, .onHead, .overTheEar:
        // Accessory is being worn
        break
    case .offHead:
        // Accessory is not being worn
        break
    @unknown default:
        break
    }
}

Error Handling

AccessoryControlDevice.Error covers failure cases during registration and updates:

ErrorCause
.accessoryNotCapableAccessory does not support the requested capability
.invalidRequestRequest parameters are invalid
.invalidatedDevice registration has been invalidated
.unknownAn unspecified error occurred

Handle errors from registration and update calls:

do {
    try await AccessoryControlDevice.register(accessory, capabilities)
} catch let error as AccessoryControlDevice.Error {
    switch error {
    case .accessoryNotCapable:
        // Accessory hardware does not support requested capabilities
        break
    case .invalidRequest:
        // Check registration parameters
        break
    case .invalidated:
        // Re-register the device
        break
    case .unknown:
        // Log and retry
        break
    @unknown default:
        break
    }
}

Common Mistakes

DON'T: Register before pairing with AccessorySetupKit

// WRONG -- accessory not yet paired
let rawAccessory = ASAccessory()
try await AccessoryControlDevice.register(rawAccessory, [.audioSwitching])

// CORRECT -- use the ASAccessory from a completed pairing session
session.activate(on: .main) { event in
    if event.eventType == .accessoryAdded, let accessory = event.accessory {
        Task {
            try await AccessoryControlDevice.register(accessory, [.audioSwitching])
        }
    }
}

DON'T: Declare placement capability without updating placement

// WRONG -- registers placement but never updates it
try await AccessoryControlDevice.register(accessory, [.audioSwitching, .placement])
// System never receives placement data, reducing switching accuracy

// CORRECT -- update placement promptly after registration
try await AccessoryControlDevice.register(accessory, [.audioSwitching, .placement])
let device = try AccessoryControlDevice.current(for: accessory)
var config = device.configuration
config.devicePlacement = .offHead
try await device.update(config)

DON'T: Ignore connection state changes for multi-device accessories

// WRONG -- set audio source identifiers once and never update
config.primaryAudioSourceDeviceIdentifier = someAddress
try await device.update(config)
// Device disconnects, but system still thinks it's the primary source

// CORRECT -- update identifiers when connections change
func onDeviceDisconnected() {
    var config = device.configuration
    config.primaryAudioSourceDeviceIdentifier = nil
    Task { try await device.update(config) }
}

DON'T: Forget to handle the invalidated error

// WRONG -- ignores invalidation, keeps using stale device reference
try await device.update(config)  // Throws .invalidated, unhandled

// CORRECT -- catch invalidation and re-register
do {
    try await device.update(config)
} catch AccessoryControlDevice.Error.invalidated {
    try await AccessoryControlDevice.register(accessory, capabilities)
}

Review Checklist

  • Accessory paired via AccessorySetupKit before AudioAccessoryKit registration
  • Both AccessorySetupKit and AudioAccessoryKit imported
  • Capabilities declared at registration match actual hardware support
  • .placement capability accompanied by ongoing placement updates
  • Placement transitions (on/off head) reported promptly
  • Audio source device identifiers updated on Bluetooth connection changes
  • All AccessoryControlDevice.Error cases handled, including @unknown default
  • update(_:) calls use try await and handle errors
  • Invalidated device references re-registered when needed
  • Deployment target set to iOS 26.4+ or iPadOS 26.4+

References

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.09%
按下载量换算1,704

Claude

29.49%
按下载量换算1,432

Cursor

17.27%
按下载量换算838

Gemini CLI

8.71%
按下载量换算423

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills