We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9d3b6c commit a3d6e1aCopy full SHA for a3d6e1a
harmony-os/SherpaOnnxVadAsr/entry/src/main/ets/pages/Index.ets
@@ -46,8 +46,14 @@ struct Index {
46
const permissions: Permissions[] = ["ohos.permission.MICROPHONE"];
47
let allowed: boolean = await allAllowed(permissions);
48
if (!allowed) {
49
- requestPermissions(permissions);
50
console.log("request to access the microphone");
+ const status: boolean = await requestPermissions(permissions);
51
+
52
+ if (!status) {
53
+ console.error('access to microphone is denied')
54
+ this.resultForMic = "Failed to get microphone permission. Please retry";
55
+ return;
56
+ }
57
58
allowed = await allAllowed(permissions);
59
0 commit comments