Show HN: SpeechAnalyzerDylib – C-FFI for macOS 26.0 SpeechAnalyzer API

github.com

2 points by aethiopicuschan 9 hours ago

Hi HN,

I’m excited to share SpeechAnalyzerDylib, a tiny C-compatible dynamic library that wraps Apple’s upcoming SpeechAnalyzer API in macOS 26.0 (Tahoe). If you’re building a Swift, Objective-C, or plain C project and want to add on-device transcription with virtually no boilerplate, this might help.

## Key Features

- *C-FFI wrapper* Exposes a simple, C-compatible API so you can call from Swift, Objective-C or plain C.

- *Asynchronous File Transcription* `sw_transcribeFile(const char filePath, const char locale, TranscriptionCallback callback, void userData)` Transcribe any audio file on disk in the background; delivers full transcript or error string via your callback.

- *In-Memory Data Transcription* `sw_transcribeData(const uint8_t bytes, size_t size, const char locale, TranscriptionCallback callback, void userData)` Transcribe raw audio buffers by internally writing a temp file and reusing the file-based transcription path.

- *Live Microphone Streaming* `sw_startMicrophoneTranscription(const char locale, TranscriptionCallback callback, void userData)` Stream real-time speech from the default mic, receive partial transcripts as they arrive, and stop automatically when the engine stops.

- *Locale-Aware* All APIs accept an optional locale identifier (defaults to system locale) for language-specific models.

- *Automatic Model Management* Verifies or downloads the needed offline speech model for your chosen locale before starting transcription.

- *Callback-Driven Error Handling* On failure, your callback receives an `"Error: …"` string so you can handle retries or fallbacks.

- *Zero External Dependencies* Built solely on Apple’s AVFoundation & Speech frameworks—no third-party libraries required.

## Version requirements

macOS 26.0 (Tahoe) beta Xcode 26 beta

Both are currently in beta, and SpeechAnalyzer is only available on the beta seed, so you’ll need to be running the developer betas to try it out.

## Repository & license

https://github.com/aethiopicuschan/speech-analyzer-dylib Licensed under MIT.

## Feedback & contributions welcome

Open issues for bugs or edge cases you encounter Submit PRs to add tests, CI, or sample integrations Share your experiences or integration questions below Looking forward to hearing what you build with it!