ScanTones class abstract final

The built-in feedback tones and a tiny WAV synthesizer.

The sound files in assets/sounds/ are made by tool/generate_sounds.dart from these definitions with renderWav; they are this package's own work (MIT). You can also call renderWav at runtime and play the bytes.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

assetKeyOf(ScanFeedbackKind kind) → String
Flutter asset key of the bundled file for kind, for use from an app.
fileNameOf(ScanFeedbackKind kind) → String
File name of kind in assets/sounds/.
renderWav(List<ToneSegment> segments, {int sampleRate = ScanTones.sampleRate, double amplitude = ScanTones.amplitude, Duration fade = const Duration(milliseconds: 6)}) → Uint8List
Renders segments as a 16-bit mono PCM WAV file.
segmentsOf(ScanFeedbackKind kind) → List<ToneSegment>
The segments of kind.
wavOf(ScanFeedbackKind kind) → Uint8List
The WAV bytes of kind, identical to the bundled asset.

Constants

accepted → const List<ToneSegment>
One short high beep.
amplitude → const double
Peak amplitude of the bundled files (0..1).
duplicate → const List<ToneSegment>
Two short mid beeps.
rejected → const List<ToneSegment>
A falling low two-tone buzz.
sampleRate → const int
Sample rate of the bundled files.