Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Voice to Intelligence

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Voice to Intelligence

A presentation about SpeechAnalyzer and Foundation Models with examples and best practices.

Avatar for Krishna Venkatramani

Krishna Venkatramani

June 23, 2026

Other Decks in Technology

Transcript

  1. What is SpeechAnalyzer? • New API in iOS 26, iPadOS

    26, macOS 26, tvOS 26, visionOS 26 • Great for: Long-form audio , word-by-word transcription • 100% on-device — audio never leaves the device • No Siri or Dictation settings required • Built for Swift concurrency: async/await + AsyncSequence
  2. Volatile vs. Finalized Results • Volatile: fast, rough guesses (result.isFinal

    == false) • Show immediately with low opacity • Gives users ‘I am being heard’ feedback • Finalized: accurate, permanent text (result.isFinal == true) • Non-overlapping, safe to persist • Delivered in CMTimeRange segments without overlap
  3. Transcribing a File • Create SpeechTranscriber(locale, preset: .o ffl ineTranscription)

    • Collect results concurrently with async let and reduce • Initialize SpeechAnalyzer and feed audio fi le • Finalize or cancel analyzer session based on last sample • Await collected string — pure async/await, no callbacks
  4. Word-Level Timestamps • Enable with attributeOptions: [.audioTimeRange] • Each word

    carries a CMTimeRange attribute • AttributedString integrates natively — no index math
  5. What Is the Foundation Models Framework? • Direct access to

    the on-device large language model powering Apple Intelligence. • Optimized for content generation, summarization, and extraction
  6. Guided Generation — Structured Output • Constrained decoding prevents invalid

    output • De fi ne schemas with @Generable and @Guide • Guarantees structural correctness and improves accuracy
  7. Snapshot Streaming • Streams valid partial struct states instead of

    token di ff s • Each @Generable type has a PartiallyGenerated mirror • SwiftUI binds snapshots for smooth progressive updates
  8. Tool Calling • Model autonomously invokes on-device functions • Arguments

    validated via @Generable for safety • Tool outputs re-injected into transcript seamlessly
  9. Prompt Design Best Practices • Use clear, single-command prompts to

    control output • Provide fewer than fi ve examples or one-shot inputs • Leverage PromptBuilder and "DO NOT" to suppress unwanted text
  10. Performance & Optimization • Prewarm the model on user intent

    for instant responses • Exclude schemas from prompts to reduce token count • Use greedy sampling to ensure consistent tool calls
  11. Q&A