accessorysetupkit
Discover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery…
Transcribe speech to text using Apple's Speech framework. Use when implementing live microphone transcription with AVAudioEngine, recognizing recorded audio files, handling speech and microphone authorization, choosing on-device vs server-backed SFSpeechRecognizer behavior, or
$ npx -y skills add dpearson2699/swift-ios-skills --skill speech-recognition --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/speech-recognitionContext preview
The summary Claude sees to decide when to auto-load this skill.
Transcribe speech to text using Apple's Speech framework. Use when implementing live microphone transcription with AVAudioEngine, recognizing recorded audio files, handling speech and microphone authorization, choosing on-device vs server-backed SFSpeechRecognizer behavior, or
name: speech-recognition description: "Transcribe speech to text using Apple's Speech framework. Use when implementing live microphone transcription with AVAudioEngine, recognizing recorded audio files, handling speech and microphone authorization, choosing on-device vs server-backed SFSpeechRecognizer behavior, or adopting SpeechAnalyzer, SpeechTranscriber, DictationTranscriber, AssetInventory, and async result streams on iOS 26+."
Transcribe live and pre-recorded audio to text using Apple's Speech framework. Covers `SpeechAnalyzer` / `SpeechTranscriber` (iOS 26+) and `SFSpeechRecognizer` (iOS 10+) fallback guidance.
**Scope boundary:** Use this skill for speech-to-text recognition, speech authorization, microphone capture plumbing, and result handling. Hand off text analysis, language identification after transcription, sentiment, embeddings, and translation to `natural-language`; hand off audio playback UI to `avkit`; hand off summarization or generation over transcripts to `apple-on-device-ai`.
Use `SpeechAnalyzer` for modern iOS 26+ speech analysis, especially long-form recordings, live transcription, time-indexed transcripts, and fully on-device flows. Keep `SFSpeechRecognizer` for iOS 10+ deployment targets, server-backed locale coverage, or existing callback/delegate implementations.
Read [SpeechAnalyzer patterns](references/speechanalyzer-patterns.md) when implementing an iOS 26+ transcription pipeline, model asset handling, volatile results, or file/buffer examples.
1. Choose the module:
current device or locale and dictation-compatible support is acceptable.
activity detection is worth the accuracy/power tradeoff. 2. Check support before creating the session:
language choices. 3. Pick a documented preset:
`audioTimeRange`. 4. Install required assets with `AssetInventory.assetInstallationRequest`. 5. Convert live audio buffers to `SpeechAnalyzer.bestAvailableAudioFormat(compatibleWith:)` before yielding `AnalyzerInput`. 6. Consume module results from their `AsyncSequence` in a separate task. 7. Finish explicitly with `finalizeAndFinish(through:)`, `finalizeAndFinishThroughEndOfInput()`, or `cancelAndFinishNow()`.
Do not use an `offlineTranscription` preset; Apple does not document one. Finishing an `AsyncStream` input sequence does not finish the analyzer session.
import Speech
// Default locale (user's current language)
let recognizer = SFSpeechRecognizer()
// Specific locale
let recognizer = SFSpeechRecognizer(locale: Locale(identifier: "en-US"))
// Check if recognition is available for this locale
guard let recognizer, recognizer.isAvailable else {
print("Speech recognition not available")
return
}final class SpeechManager: NSObject, SFSpeechRecognizerDelegate {
private let recognizer = SFSpeechRecognizer()!
override init() {
super.init()
recognizer.delegate = self
}
func speechRecognizer(
_ speechRecognizer: SFSpeechRecognizer,
availabilityDidChange available: Bool
) {
// Update UI — disable record button when unavailable
}
}Request **both** speech recognition and microphone permissions before starting live transcription. Add these keys to `Info.plist`:
import Speech
import AVFoundation
func requestPermissions() async -> Bool {
let speechStatus = await withCheckedContinuation { continuation in
SFSpeechRecognizer.requestAuthorization { status in
continuation.resume(returning: status)
}
}
guard speechStatus == .authorized else { return false }
let micStatus: Bool
if #available(iOS 17, *) {
micStatus = await AVAudioApplication.requestRecordPermission()
} else {
micStatus = await withCheckedContinuation { continuation in
AVAudioSession.sharedInstance().requestRecordPermission { granted in
continuation.resume(returning: granted)
}
}
}
return micStatus
}The standard pattern: `AVAudioEngine` captures microphone audio → buffers are appended to `SFSpeechAudioBufferRecognitionRequest` → results stream in.
import Speech
import AVFoundation
final class LiveTranscriber {
private let recognizer = SFSpeechRecognizer(locale: Locale(identifier: "en-US"))!
private let audioEngine = AVAudioEngine()
private var recognitionRequest: SFSpeechAudioBufferRecognitionRequest?
private var recognitionTask: SFSpeechRecognitionTask?
func startTranscribing() throws {
/86 agent skills optimized for iOS 26+ development with Swift 6.3 and modern Apple frameworks.
Repo: dpearson2699/swift-ios-skills
Discover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery…
Implement, review, or improve Live Activities and Dynamic Island experiences in iOS apps using ActivityKit. Use when building real-time updating widgets for…
Measure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks,…
Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, StandBy, and paired Apple Watch system UI. Covers…
Build iOS App Clips with invocation URLs, App Clip Codes, NFC, QR codes, Safari banners, Maps, Messages, target setup, App Store Connect experiences,…
Implement App Intents for Siri, Shortcuts, Spotlight, widgets, Control Center, and Apple Intelligence on iOS. Covers AppIntent actions, AppEntity and…