ml: lay the foundation of SODA in CrOS
1. Add the helper files soda.{h,cc} for the proxy of libsoda.so.
2. We have soda_recognizer_impl.cc and soda_recognizer_impl_dummy.cc.
The former is the real implementation and will be used when "internal"
and "ondevice_speech" are used. Otherwise, the latter will be used and
it will cause crash/errors during tests.
BUG=b:160550533
TEST=SODA works on device (can recognize and send the result to Chrome).
TEST=both `USE=ondevice_speech emerge-eve ml` and ` emerge-eve ml` work
Cq-Depend: 2374425
Change-Id: Ieb453a4ae97807a8a4eecba010a0cdb0521eada9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2377167
Reviewed-by: Michael Mortensen <mmortensen@google.com>
Reviewed-by: Andrew Moylan <amoylan@chromium.org>
Tested-by: Honglin Yu <honglinyu@chromium.org>
Commit-Queue: Honglin Yu <honglinyu@chromium.org>
diff --git a/ml/machine_learning_service_impl.h b/ml/machine_learning_service_impl.h
index e93fcc1..b1096c3 100644
--- a/ml/machine_learning_service_impl.h
+++ b/ml/machine_learning_service_impl.h
@@ -69,6 +69,13 @@
mojo::PendingReceiver<
chromeos::machine_learning::mojom::HandwritingRecognizer> receiver,
LoadHandwritingModelWithSpecCallback callback) override;
+ void LoadSpeechRecognizer(
+ chromeos::machine_learning::mojom::SodaConfigPtr spec,
+ mojo::PendingRemote<chromeos::machine_learning::mojom::SodaClient>
+ soda_client,
+ mojo::PendingReceiver<chromeos::machine_learning::mojom::SodaRecognizer>
+ soda_recognizer,
+ LoadSpeechRecognizerCallback callback) override;
// Init the icu data if it is not initialized yet.
void InitIcuIfNeeded();