Skip to content

修复无法捕获事件 #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed android/libs/Msc.jar
Binary file not shown.
Binary file removed android/libs/Sunflower.jar
Binary file not shown.
Binary file removed android/libs/arm64-v8a/libmsc.so
Binary file not shown.
Binary file removed android/libs/armeabi-v7a/libmsc.so
Binary file not shown.
Binary file removed android/libs/armeabi/libmsc.so
Binary file not shown.
Binary file removed android/libs/mips/libmsc.so
Binary file not shown.
Binary file removed android/libs/mips64/libmsc.so
Binary file not shown.
Binary file removed android/libs/x86/libmsc.so
Binary file not shown.
Binary file removed android/libs/x86_64/libmsc.so
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/

public class SpeechRecognizerModule extends ReactContextBaseJavaModule {
private Context context;
private final ReactApplicationContext context;

private static SpeechRecognizer mIat;
private static RecognizerListener mIatListener;
Expand Down Expand Up @@ -69,7 +69,7 @@ public void init(String AppId) {
public void onVolumeChanged(int volume, byte[] bytes) {
WritableMap params = Arguments.createMap();
params.putInt("volume", volume);
SpeechRecognizerModule.this.onJSEvent(getReactApplicationContext(), "onRecognizerVolumeChanged", params);
SpeechRecognizerModule.this.onJSEvent(context, "onRecognizerVolumeChanged", params);
}

@Override
Expand Down Expand Up @@ -221,7 +221,7 @@ private void onIatResult(RecognizerResult results, boolean isLast) {
result = "";
}

this.onJSEvent(getReactApplicationContext(), "onRecognizerResult", params);
this.onJSEvent(context, "onRecognizerResult", params);
}

private void onIatError(SpeechError error) {
Expand All @@ -231,7 +231,7 @@ private void onIatError(SpeechError error) {
params.putString("message", error.getErrorDescription());
params.putString("plainDescription", error.getPlainDescription(true));

this.onJSEvent(getReactApplicationContext(),"onRecognizerError",params);
this.onJSEvent(context,"onRecognizerError",params);
}

private void showTip(final String str) {
Expand Down