TfliteAudio class

Class which manages the future and stream for the plugins

Constructors

TfliteAudio()

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

loadModel({required String model, required String label, required String inputType, bool outputRawScores = false, int numThreads = 1, bool isAsset = true}) Future
initialize loadModel before calling any other streams and futures.
setSpectrogramParameters({bool shouldTranspose = false, int nMFCC = 20, int nFFT = 2048, int nMels = 128, int hopLength = 512}) Future
Call setSpectrogramParameters to adjust the default spectro parameters
startAudioRecognition({required int sampleRate, required int bufferSize, int audioLength = 0, double detectionThreshold = 0.3, int numOfInferences = 1, int averageWindowDuration = 0, int minimumTimeBetweenSamples = 0, int suppressionTime = 0, String method = 'setAudioRecognitionStream'}) Stream<Map>
startAudioRecognition returns map objects with the following values: String recognitionResult, int inferenceTime, bool hasPermission Do not change the parameter 'method'
startFileRecognition({required String audioDirectory, required int sampleRate, int audioLength = 0, double detectionThreshold = 0.3, int averageWindowDuration = 0, int minimumTimeBetweenSamples = 0, int suppressionTime = 0, String method = 'setFileRecognitionStream'}) Stream<Map>
Load stored audio file, preprocess and then fed into model.
stopAudioRecognition() Future
call stopAudioRecognition to forcibly stop recording, recognition and stream.