Let me explain
I managed to wrap the entire Cognitive Speech Library in a cordova plugin. ( .aar sdk file and .so native library arm files)
It works, i can initialize and start listening on the mic normally getting results back on onFinalResponseReceived() and sending them back to the webview cordova app.
All works well, apart from onAudioEvent(), when packaged as cordova plugin, that function doesnt fire, so i cant detect when speech recognition is/stopped working.
The problem isnt that i cant send results back, no in the native plugin code itself onAudioEvent() no longer triggers.
this is my class relevant parts
public class BingSpeechPlugin extends CordovaPlugin implements ISpeechRecognitionServerEvents
this.micClient = SpeechRecognitionServiceFactory.createMicrophoneClient(
cordova.getActivity(),
mode,
language,
this,
bingkey);
the same code works fine and onAudioEvent() triggers properly if run directly as a native app from android studio without the cordova plugin package.
startMicAndRecognition() works fine in cordova plugin mode and i do get results on onFinalResponseReceived()
onAudioEvent() on the other hand doesnt seem to auto trigger anymore