Skip to content

Commit fabd30e

Browse files
authored
Fix microphone privacy config (#727)
1 parent 3acf373 commit fabd30e

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

ios-swiftui/SherpaOnnx/SherpaOnnx.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
C924F35F29DDB05D00A440A5 /* onnxruntime.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = onnxruntime.xcframework; path = "../../build-ios/ios-onnxruntime/onnxruntime.xcframework"; sourceTree = "<group>"; };
5858
C924F36129DDB15D00A440A5 /* Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extension.swift; sourceTree = "<group>"; };
5959
C924F36329DDB1D500A440A5 /* SherpaOnnxViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SherpaOnnxViewModel.swift; sourceTree = "<group>"; };
60+
DEFC34EE2BBA8AD100E174E9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
6061
/* End PBXFileReference section */
6162

6263
/* Begin PBXFrameworksBuildPhase section */
@@ -110,6 +111,7 @@
110111
C924F32C29DDAC0B00A440A5 /* SherpaOnnx */ = {
111112
isa = PBXGroup;
112113
children = (
114+
DEFC34EE2BBA8AD100E174E9 /* Info.plist */,
113115
C924F36329DDB1D500A440A5 /* SherpaOnnxViewModel.swift */,
114116
C924F36129DDB15D00A440A5 /* Extension.swift */,
115117
C924F35D29DDAE8200A440A5 /* Model.swift */,
@@ -451,9 +453,12 @@
451453
CODE_SIGN_STYLE = Automatic;
452454
CURRENT_PROJECT_VERSION = 1;
453455
DEVELOPMENT_ASSET_PATHS = "\"SherpaOnnx/Preview Content\"";
456+
DEVELOPMENT_TEAM = "";
454457
ENABLE_PREVIEWS = YES;
455458
GENERATE_INFOPLIST_FILE = YES;
456459
HEADER_SEARCH_PATHS = "${PROJECT_DIR}/../../build-ios/sherpa-onnx.xcframework/Headers/";
460+
INFOPLIST_FILE = SherpaOnnx/Info.plist;
461+
INFOPLIST_KEY_NSMicrophoneUsageDescription = "Use microphone to record voice";
457462
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
458463
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
459464
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
@@ -482,9 +487,12 @@
482487
CODE_SIGN_STYLE = Automatic;
483488
CURRENT_PROJECT_VERSION = 1;
484489
DEVELOPMENT_ASSET_PATHS = "\"SherpaOnnx/Preview Content\"";
490+
DEVELOPMENT_TEAM = "";
485491
ENABLE_PREVIEWS = YES;
486492
GENERATE_INFOPLIST_FILE = YES;
487493
HEADER_SEARCH_PATHS = "${PROJECT_DIR}/../../build-ios/sherpa-onnx.xcframework/Headers/";
494+
INFOPLIST_FILE = SherpaOnnx/Info.plist;
495+
INFOPLIST_KEY_NSMicrophoneUsageDescription = "Use microphone to record voice";
488496
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
489497
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
490498
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict/>
5+
</plist>

ios-swiftui/SherpaOnnx/SherpaOnnx/SherpaOnnxViewModel.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ enum Status {
1313
case recording
1414
}
1515

16+
@MainActor
1617
class SherpaOnnxViewModel: ObservableObject {
1718
@Published var status: Status = .stop
1819
@Published var subtitles: String = ""
@@ -44,9 +45,7 @@ class SherpaOnnxViewModel: ObservableObject {
4445
}
4546

4647
func updateLabel() {
47-
DispatchQueue.main.async {
48-
self.subtitles = self.results
49-
}
48+
self.subtitles = self.results
5049
}
5150

5251
init() {

0 commit comments

Comments
 (0)