Replaces O(n^2) std::find scan with O(1)-avg hash-set lookup,
addressing the existing "would be nice to have faster search"
comment. Total cost drops from O(num_frames * |nonsilence|) to
O(num_frames + |nonsilence|).
Allows callers to control the audio input device - for example, to pin
recording to the built-in microphone when an external USB camera without
a microphone causes Android to silently select the wrong input source.
The new overload (Recognizer, float, AudioRecord) mirrors the existing
(Recognizer, float) signature. Ownership semantics differ: the caller
supplies and owns the recorder, so on failure this constructor throws
without releasing it, leaving cleanup to the caller.
Co-authored-by: Kevin Brown <git@whidit.com>
Expose the AudioRecord session ID so callers can attach Android audio
effects (e.g. NoiseSuppressor, AcousticEchoCanceler) to the recording
session without subclassing or reflection.
Co-authored-by: Kevin Brown <git@whidit.com>
* Added Batch P/Invoke to be able to use GPU based inference
* Modified Result method
* Modified Result method
* Fixed code to call BatchModel
---------
Co-authored-by: minsik.sim <minsik.sim@cyara.com>
* Init
* Implement common
* Implement JVM target
* Ignore build/ directory
* Implement android
* Disable kotlin/native targets
* Remove jCenter()
* Upgrade android tools to 7.3.0
* Enforce not null for essential windows operations
* Add license headers
* Add maven-publish
* Add dokka for javadoc
* Add disabled kotlin/native for linux
This is disabled currently due to vosk
not having a proper installation method on linux yet.
* Add empty constructors for JVM classes
* Fix library initialization for JVM
* Add DecoderDemo
* Add serialization support
* Convert no arg functions with returns to val properties
* Properly implement DecoderTest
* Import other android classes
* Properly name json parser as voskJson
* Add license headers to native target
* Unify free functions with Freeable interface
This makes it easy for Kotlin/Native to use a "use" function to
auto free after use of a Freeable.
* Document JVM default constructor
* Add JVM specific constructors with NIO/IO
* Inline default constructors in Common
* Properly handle invalid paths
* Add android publishing block
* Merge serialization into common
* Update to Kotlin 1.8.10
* Update to JNA 5.13.0
* Put native target behind environment variable or override.
Due to a lack of official packaging,
this is not possible currently.
* Properly handle Recognizer.acceptWaveform exceptions
* Add flow extension for converting (InputStream->Recognizer) to a flow.
* Use ByteFlow for waveform flow instead.
This allows custom readers, and more advanced backends,
such as the Dicio example in DecoderTest.kt .