speech_kit 0.0.2 copy "speech_kit: ^0.0.2" to clipboard
speech_kit: ^0.0.2 copied to clipboard

PlatformmacOS

Native Dart bindings for Apple Speech (SpeechAnalyzer, SpeechTranscriber, AssetInventory) using Dart Build Hooks.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased #

0.0.2 - 2026-09-02 #

Fixed #

  • analyzeFile copied nothing before hopping onto a Swift Task, so the Dart-owned input buffers were read after Dart freed them. This made analyzeFile fail with NSCocoaErrorDomain 3840 ("The data couldn't be read...") in Flutter apps (#1).
  • assetInventoryStatus and ensureAssetsInstalled now copy their JSON input the same way, so the native side no longer depends on when Dart frees the buffers. Dart already keeps those allocations until the callback; this is defensive hardening, not the Flutter analyzeFile failure.
  • analyzePcm and analyzePcmStream now copy their JSON pointer inputs before the Swift Task the same way. pcmBytes was already copied synchronously.

0.0.1 - 2026-03-26 #

First pub.flutter-io.cn release: native Dart bindings for Apple Speech (SpeechAnalyzer pipeline) on macOS via Dart Build Hooks and FFI.

Added #

  • SpeechKit façade — speech and microphone permission status/requests; AssetInventory status and ensureAssetsInstalled; bestAvailableAudioFormat; analyzeFile / analyzePcm / analyzePcmStream with optional AnalysisContext and SpeechAnalyzerOptions; SpeechAnalysisSession with TranscriptionSegment streaming; endSpeechModelRetention.
  • Custom language modelexportCustomLanguageModelData (phrase counts, custom pronunciations, optional PhraseCountsFromTemplatesConfig), prepareCustomLanguageModel, supportedCustomLanguagePhonemes, SpeechLanguageModelPaths for dictation.
  • Repository layoutlib/, test/, native/ Swift bridge, architecture rule .cursor/rules/architecture-ddd-layered.mdc, and doc/domain-model.md.
  • Example package (example/) — CLI samples: permission_status, asset_inventory, best_audio_format (with --install to fetch on-device models when needed), supported_phonemes, export_custom_lm, end_model_retention, analyze_file (optional --bias, --task-priority, --model-retention); shared lib/example_common.dart; example/README.md with overview table and tree-style layout.

Changed #

  • Static analysis aligned with screen-capture-kit (all_lint_rules.yaml + shared analysis_options.yaml pattern; drop package:lints).
  • Documentation — README (structure aligned with screen-capture-kit), CONTRIBUTING.md, and doc/domain-model.md updated for the implemented API and macOS-only native path.
  • pubspec.yamlplatforms limited to macOS until iOS FFI is supported.
0
likes
150
points
68
downloads

Documentation

Documentation
API reference

Publisher

verified publisherblendthink.dev

Weekly Downloads

Native Dart bindings for Apple Speech (SpeechAnalyzer, SpeechTranscriber, AssetInventory) using Dart Build Hooks.

Repository (GitHub)
View/report issues
Contributing

Topics

#speech #speech-recognition #macos #ffi

License

BSD-3-Clause (license)

Dependencies

code_assets, ffi, hooks, meta

More

Packages that depend on speech_kit