Skip to main content

earshot_classifier_platform_interface 1.0.0 copy "earshot_classifier_platform_interface: ^1.0.0" to clipboard
earshot_classifier_platform_interface: ^1.0.0 copied to clipboard

The pure Dart platform interface for earshot_classifier, with the shared types for on-device sound classification.

earshot_classifier_platform_interface #

pub package style: very good analysis License: MIT

The pure Dart platform interface for earshot_classifier. Apps should depend on earshot_classifier instead.

It holds the types every backend shares: SoundDetection, SoundGroup, ClassifierBackend, the EarshotSound vocabulary and SoundVocabulary, which maps each backend's raw labels to sounds and groups.

Part of earshot: on-device ambient listening with no network access, where no audio leaves the device.

Implementing a backend #

A platform implementation extends EarshotClassifierPlatform and classifies PCM captured by earshot_capture:

  • isAvailable() tells whether the backend can run on this device. It must never prompt the user.
  • classify(Stream<PcmChunk> pcm, ClassifierConfig config) starts a session on each listen(), listens to pcm, and stops on cancel. It reports every label at or above config.minConfidence in each analysis window, built with SoundVocabulary().detection(...), timestamped on the PCM clock, and never throws synchronously.
  • detections(ClassifierConfig config) captures with earshot_capture and classifies the result the same way.

earshot_classifier applies the confidence threshold and smoothing on top, the same way for every backend. See ADR 0014.

Disclaimer #

earshot is informational and is not a certified detector. Never rely on it for safety, including smoke and carbon monoxide alarms.

0
likes
160
points
406
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

The pure Dart platform interface for earshot_classifier, with the shared types for on-device sound classification.

Repository (GitHub)
View/report issues
Contributing

Topics

#audio #sound-classification #plugin-interface

License

MIT (license)

Dependencies

earshot_capture_platform_interface, meta, plugin_platform_interface

More

Packages that depend on earshot_classifier_platform_interface