Digipom commited on
Commit
1d5c7f2
·
unverified ·
1 Parent(s): 7a0b310

examples : add whisper.swiftui demo app (#308)

Browse files

* Add SwiftUI demo project.

* Add -DGGML_USE_ACCELERATE

Files changed (18) hide show
  1. examples/whisper.swiftui/README.md +12 -0
  2. examples/whisper.swiftui/whisper.cpp.swift/LibWhisper.swift +70 -0
  3. examples/whisper.swiftui/whisper.cpp.swift/WhisperCppDemo-Bridging-Header.h +4 -0
  4. examples/whisper.swiftui/whisper.swiftui.demo/Models/WhisperState.swift +162 -0
  5. examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  6. examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Assets.xcassets/AppIcon.appiconset/Contents.json +63 -0
  7. examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Assets.xcassets/Contents.json +6 -0
  8. examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Preview Content/Preview Assets.xcassets/Contents.json +6 -0
  9. examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/WhisperCppDemo.entitlements +12 -0
  10. examples/whisper.swiftui/whisper.swiftui.demo/UI/ContentView.swift +43 -0
  11. examples/whisper.swiftui/whisper.swiftui.demo/Utils/Recorder.swift +35 -0
  12. examples/whisper.swiftui/whisper.swiftui.demo/Utils/RiffWaveUtils.swift +12 -0
  13. examples/whisper.swiftui/whisper.swiftui.demo/WhisperCppDemoApp.swift +10 -0
  14. examples/whisper.swiftui/whisper.swiftui.xcodeproj/.gitignore +1 -0
  15. examples/whisper.swiftui/whisper.swiftui.xcodeproj/project.pbxproj +467 -0
  16. examples/whisper.swiftui/whisper.swiftui.xcodeproj/project.xcworkspace/.gitignore +1 -0
  17. examples/whisper.swiftui/whisper.swiftui.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  18. examples/whisper.swiftui/whisper.swiftui.xcodeproj/xcshareddata/xcschemes/WhisperCppDemo.xcscheme +100 -0
examples/whisper.swiftui/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ A sample SwiftUI app using [whisper.cpp](https://github.com/ggerganov/whisper.cpp/) to do voice-to-text transcriptions.
2
+ See also: [whisper.objc](https://github.com/ggerganov/whisper.cpp/tree/master/examples/whisper.objc).
3
+
4
+ To use:
5
+
6
+ 1. Select a model from the [whisper.cpp repository](https://github.com/ggerganov/whisper.cpp/tree/master/models).[^1]
7
+ 2. Add the model to "whisper.swiftui.demo/Resources/models" via Xcode.
8
+ 3. Select a sample audio file (for example, [jfk.wav](https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav)).
9
+ 4. Add the model to "whisper.swiftui.demo/Resources/samples" via Xcode.
10
+ 5. Select the "release" build configuration under "Run", then deploy and run to your device.
11
+
12
+ [^1]: I recommend the tiny, base or small models for running on an iOS device.
examples/whisper.swiftui/whisper.cpp.swift/LibWhisper.swift ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Foundation
2
+
3
+ enum WhisperError: Error {
4
+ case couldNotInitializeContext
5
+ }
6
+
7
+ // Meet Whisper C++ constraint: Don't access from more than one thread at a time.
8
+ actor WhisperContext {
9
+ private var context: OpaquePointer
10
+
11
+ init(context: OpaquePointer) {
12
+ self.context = context
13
+ }
14
+
15
+ deinit {
16
+ whisper_free(context)
17
+ }
18
+
19
+ func fullTranscribe(samples: [Float]) {
20
+ // Leave 2 processors free (i.e. the high-efficiency cores).
21
+ let maxThreads = max(1, min(8, cpuCount() - 2))
22
+ print("Selecting \(maxThreads) threads")
23
+ var params = whisper_full_default_params(WHISPER_SAMPLING_GREEDY)
24
+ "en".withCString { en in
25
+ // Adapted from whisper.objc
26
+ params.print_realtime = true
27
+ params.print_progress = false
28
+ params.print_timestamps = true
29
+ params.print_special = false
30
+ params.translate = false
31
+ params.language = en
32
+ params.n_threads = Int32(maxThreads)
33
+ params.offset_ms = 0
34
+ params.no_context = true
35
+ params.single_segment = false
36
+
37
+ whisper_reset_timings(context)
38
+ print("About to run whisper_full")
39
+ samples.withUnsafeBufferPointer { samples in
40
+ if (whisper_full(context, params, samples.baseAddress, Int32(samples.count)) != 0) {
41
+ print("Failed to run the model")
42
+ } else {
43
+ whisper_print_timings(context)
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+ func getTranscription() -> String {
50
+ var transcription = ""
51
+ for i in 0..<whisper_full_n_segments(context) {
52
+ transcription += String.init(cString: whisper_full_get_segment_text(context, i))
53
+ }
54
+ return transcription
55
+ }
56
+
57
+ static func createContext(path: String) throws -> WhisperContext {
58
+ let context = whisper_init(path)
59
+ if let context {
60
+ return WhisperContext(context: context)
61
+ } else {
62
+ print("Couldn't load model at \(path)")
63
+ throw WhisperError.couldNotInitializeContext
64
+ }
65
+ }
66
+ }
67
+
68
+ fileprivate func cpuCount() -> Int {
69
+ ProcessInfo.processInfo.processorCount
70
+ }
examples/whisper.swiftui/whisper.cpp.swift/WhisperCppDemo-Bridging-Header.h ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ //
2
+ // Use this file to import your target's public headers that you would like to expose to Swift.
3
+ //
4
+ #import "whisper.h"
examples/whisper.swiftui/whisper.swiftui.demo/Models/WhisperState.swift ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Foundation
2
+ import SwiftUI
3
+ import AVFoundation
4
+
5
+ @MainActor
6
+ class WhisperState: NSObject, ObservableObject, AVAudioRecorderDelegate {
7
+ @Published var isModelLoaded = false
8
+ @Published var messageLog = ""
9
+ @Published var canTranscribe = false
10
+ @Published var isRecording = false
11
+
12
+ private var whisperContext: WhisperContext?
13
+ private let recorder = Recorder()
14
+ private var recordedFile: URL? = nil
15
+ private var audioPlayer: AVAudioPlayer?
16
+
17
+ private var modelUrl: URL? {
18
+ Bundle.main.url(forResource: "ggml-tiny.en", withExtension: "bin", subdirectory: "models")
19
+ }
20
+
21
+ private var sampleUrl: URL? {
22
+ Bundle.main.url(forResource: "jfk", withExtension: "wav", subdirectory: "samples")
23
+ }
24
+
25
+ private enum LoadError: Error {
26
+ case couldNotLocateModel
27
+ }
28
+
29
+ override init() {
30
+ super.init()
31
+ do {
32
+ try loadModel()
33
+ canTranscribe = true
34
+ } catch {
35
+ print(error.localizedDescription)
36
+ messageLog += "\(error.localizedDescription)\n"
37
+ }
38
+ }
39
+
40
+ private func loadModel() throws {
41
+ messageLog += "Loading model...\n"
42
+ if let modelUrl {
43
+ whisperContext = try WhisperContext.createContext(path: modelUrl.path())
44
+ messageLog += "Loaded model \(modelUrl.lastPathComponent)\n"
45
+ } else {
46
+ messageLog += "Could not locate model\n"
47
+ }
48
+ }
49
+
50
+ func transcribeSample() async {
51
+ if let sampleUrl {
52
+ await transcribeAudio(sampleUrl)
53
+ } else {
54
+ messageLog += "Could not locate sample\n"
55
+ }
56
+ }
57
+
58
+ private func transcribeAudio(_ url: URL) async {
59
+ if (!canTranscribe) {
60
+ return
61
+ }
62
+ guard let whisperContext else {
63
+ return
64
+ }
65
+
66
+ do {
67
+ canTranscribe = false
68
+ messageLog += "Reading wave samples...\n"
69
+ let data = try readAudioSamples(url)
70
+ messageLog += "Transcribing data...\n"
71
+ await whisperContext.fullTranscribe(samples: data)
72
+ let text = await whisperContext.getTranscription()
73
+ messageLog += "Done: \(text)\n"
74
+ } catch {
75
+ print(error.localizedDescription)
76
+ messageLog += "\(error.localizedDescription)\n"
77
+ }
78
+
79
+ canTranscribe = true
80
+ }
81
+
82
+ private func readAudioSamples(_ url: URL) throws -> [Float] {
83
+ stopPlayback()
84
+ try startPlayback(url)
85
+ return try decodeWaveFile(url)
86
+ }
87
+
88
+ func toggleRecord() async {
89
+ if isRecording {
90
+ await recorder.stopRecording()
91
+ isRecording = false
92
+ if let recordedFile {
93
+ await transcribeAudio(recordedFile)
94
+ }
95
+ } else {
96
+ requestRecordPermission { granted in
97
+ if granted {
98
+ Task {
99
+ do {
100
+ self.stopPlayback()
101
+ let file = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
102
+ .appending(path: "output.wav")
103
+ try await self.recorder.startRecording(toOutputFile: file, delegate: self)
104
+ self.isRecording = true
105
+ self.recordedFile = file
106
+ } catch {
107
+ print(error.localizedDescription)
108
+ self.messageLog += "\(error.localizedDescription)\n"
109
+ self.isRecording = false
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ private func requestRecordPermission(response: @escaping (Bool) -> Void) {
118
+ #if os(macOS)
119
+ response(true)
120
+ #else
121
+ AVAudioSession.sharedInstance().requestRecordPermission { granted in
122
+ response(granted)
123
+ }
124
+ #endif
125
+ }
126
+
127
+ private func startPlayback(_ url: URL) throws {
128
+ audioPlayer = try AVAudioPlayer(contentsOf: url)
129
+ audioPlayer?.play()
130
+ }
131
+
132
+ private func stopPlayback() {
133
+ audioPlayer?.stop()
134
+ audioPlayer = nil
135
+ }
136
+
137
+ // MARK: AVAudioRecorderDelegate
138
+
139
+ nonisolated func audioRecorderEncodeErrorDidOccur(_ recorder: AVAudioRecorder, error: Error?) {
140
+ if let error {
141
+ Task {
142
+ await handleRecError(error)
143
+ }
144
+ }
145
+ }
146
+
147
+ private func handleRecError(_ error: Error) {
148
+ print(error.localizedDescription)
149
+ messageLog += "\(error.localizedDescription)\n"
150
+ isRecording = false
151
+ }
152
+
153
+ nonisolated func audioRecorderDidFinishRecording(_ recorder: AVAudioRecorder, successfully flag: Bool) {
154
+ Task {
155
+ await onDidFinishRecording()
156
+ }
157
+ }
158
+
159
+ private func onDidFinishRecording() {
160
+ isRecording = false
161
+ }
162
+ }
examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Assets.xcassets/AccentColor.colorset/Contents.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "colors" : [
3
+ {
4
+ "idiom" : "universal"
5
+ }
6
+ ],
7
+ "info" : {
8
+ "author" : "xcode",
9
+ "version" : 1
10
+ }
11
+ }
examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Assets.xcassets/AppIcon.appiconset/Contents.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "images" : [
3
+ {
4
+ "idiom" : "universal",
5
+ "platform" : "ios",
6
+ "size" : "1024x1024"
7
+ },
8
+ {
9
+ "idiom" : "mac",
10
+ "scale" : "1x",
11
+ "size" : "16x16"
12
+ },
13
+ {
14
+ "idiom" : "mac",
15
+ "scale" : "2x",
16
+ "size" : "16x16"
17
+ },
18
+ {
19
+ "idiom" : "mac",
20
+ "scale" : "1x",
21
+ "size" : "32x32"
22
+ },
23
+ {
24
+ "idiom" : "mac",
25
+ "scale" : "2x",
26
+ "size" : "32x32"
27
+ },
28
+ {
29
+ "idiom" : "mac",
30
+ "scale" : "1x",
31
+ "size" : "128x128"
32
+ },
33
+ {
34
+ "idiom" : "mac",
35
+ "scale" : "2x",
36
+ "size" : "128x128"
37
+ },
38
+ {
39
+ "idiom" : "mac",
40
+ "scale" : "1x",
41
+ "size" : "256x256"
42
+ },
43
+ {
44
+ "idiom" : "mac",
45
+ "scale" : "2x",
46
+ "size" : "256x256"
47
+ },
48
+ {
49
+ "idiom" : "mac",
50
+ "scale" : "1x",
51
+ "size" : "512x512"
52
+ },
53
+ {
54
+ "idiom" : "mac",
55
+ "scale" : "2x",
56
+ "size" : "512x512"
57
+ }
58
+ ],
59
+ "info" : {
60
+ "author" : "xcode",
61
+ "version" : 1
62
+ }
63
+ }
examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Assets.xcassets/Contents.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "info" : {
3
+ "author" : "xcode",
4
+ "version" : 1
5
+ }
6
+ }
examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Preview Content/Preview Assets.xcassets/Contents.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "info" : {
3
+ "author" : "xcode",
4
+ "version" : 1
5
+ }
6
+ }
examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/WhisperCppDemo.entitlements ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <key>com.apple.security.app-sandbox</key>
6
+ <true/>
7
+ <key>com.apple.security.device.audio-input</key>
8
+ <true/>
9
+ <key>com.apple.security.files.user-selected.read-only</key>
10
+ <true/>
11
+ </dict>
12
+ </plist>
examples/whisper.swiftui/whisper.swiftui.demo/UI/ContentView.swift ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import SwiftUI
2
+ import AVFoundation
3
+
4
+ struct ContentView: View {
5
+ @StateObject var whisperState = WhisperState()
6
+
7
+ var body: some View {
8
+ NavigationStack {
9
+ VStack {
10
+ HStack {
11
+ Button("Transcribe", action: {
12
+ Task {
13
+ await whisperState.transcribeSample()
14
+ }
15
+ })
16
+ .buttonStyle(.bordered)
17
+ .disabled(!whisperState.canTranscribe)
18
+
19
+ Button(whisperState.isRecording ? "Stop recording" : "Start recording", action: {
20
+ Task {
21
+ await whisperState.toggleRecord()
22
+ }
23
+ })
24
+ .buttonStyle(.bordered)
25
+ .disabled(!whisperState.canTranscribe)
26
+ }
27
+
28
+ ScrollView {
29
+ Text(verbatim: whisperState.messageLog)
30
+ .frame(maxWidth: .infinity, alignment: .leading)
31
+ }
32
+ }
33
+ .navigationTitle("Whisper SwiftUI Demo")
34
+ .padding()
35
+ }
36
+ }
37
+ }
38
+
39
+ struct ContentView_Previews: PreviewProvider {
40
+ static var previews: some View {
41
+ ContentView()
42
+ }
43
+ }
examples/whisper.swiftui/whisper.swiftui.demo/Utils/Recorder.swift ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Foundation
2
+ import AVFoundation
3
+
4
+ actor Recorder {
5
+ private var recorder: AVAudioRecorder?
6
+
7
+ enum RecorderError: Error {
8
+ case couldNotStartRecording
9
+ }
10
+
11
+ func startRecording(toOutputFile url: URL, delegate: AVAudioRecorderDelegate?) throws {
12
+ let recordSettings: [String : Any] = [
13
+ AVFormatIDKey: Int(kAudioFormatLinearPCM),
14
+ AVSampleRateKey: 16000.0,
15
+ AVNumberOfChannelsKey: 1,
16
+ AVEncoderAudioQualityKey: AVAudioQuality.high.rawValue
17
+ ]
18
+ #if !os(macOS)
19
+ let session = AVAudioSession.sharedInstance()
20
+ try session.setCategory(.playAndRecord, mode: .default)
21
+ #endif
22
+ let recorder = try AVAudioRecorder(url: url, settings: recordSettings)
23
+ recorder.delegate = delegate
24
+ if recorder.record() == false {
25
+ print("Could not start recording")
26
+ throw RecorderError.couldNotStartRecording
27
+ }
28
+ self.recorder = recorder
29
+ }
30
+
31
+ func stopRecording() {
32
+ recorder?.stop()
33
+ recorder = nil
34
+ }
35
+ }
examples/whisper.swiftui/whisper.swiftui.demo/Utils/RiffWaveUtils.swift ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Foundation
2
+
3
+ func decodeWaveFile(_ url: URL) throws -> [Float] {
4
+ let data = try Data(contentsOf: url)
5
+ let floats = stride(from: 44, to: data.count, by: 2).map {
6
+ return data[$0..<$0 + 2].withUnsafeBytes {
7
+ let short = Int16(littleEndian: $0.load(as: Int16.self))
8
+ return max(-1.0, min(Float(short) / 32767.0, 1.0))
9
+ }
10
+ }
11
+ return floats
12
+ }
examples/whisper.swiftui/whisper.swiftui.demo/WhisperCppDemoApp.swift ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import SwiftUI
2
+
3
+ @main
4
+ struct WhisperCppDemoApp: App {
5
+ var body: some Scene {
6
+ WindowGroup {
7
+ ContentView()
8
+ }
9
+ }
10
+ }
examples/whisper.swiftui/whisper.swiftui.xcodeproj/.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ xcuserdata/
examples/whisper.swiftui/whisper.swiftui.xcodeproj/project.pbxproj ADDED
@@ -0,0 +1,467 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 56;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 0A8E49002954B3F100704C1B /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 0A8E48FF2954B3F100704C1B /* README.md */; };
11
+ 0AA751482953AC2E001EE061 /* samples in Resources */ = {isa = PBXBuildFile; fileRef = 0AA751462953AC2E001EE061 /* samples */; };
12
+ 0AA751492953AC2E001EE061 /* models in Resources */ = {isa = PBXBuildFile; fileRef = 0AA751472953AC2E001EE061 /* models */; };
13
+ 0AA7514C2953B569001EE061 /* RiffWaveUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA7514B2953B569001EE061 /* RiffWaveUtils.swift */; };
14
+ 0AA7514E2953D958001EE061 /* Recorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA7514D2953D958001EE061 /* Recorder.swift */; };
15
+ 0AAC5D9B29539CCF003032C3 /* WhisperCppDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAC5D9A29539CCF003032C3 /* WhisperCppDemoApp.swift */; };
16
+ 0AAC5D9D29539CCF003032C3 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAC5D9C29539CCF003032C3 /* ContentView.swift */; };
17
+ 0AAC5D9F29539CD0003032C3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0AAC5D9E29539CD0003032C3 /* Assets.xcassets */; };
18
+ 0AAC5DA329539CD0003032C3 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0AAC5DA229539CD0003032C3 /* Preview Assets.xcassets */; };
19
+ 0AAC5DCB29539EB1003032C3 /* whisper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0AAC5DC729539EB0003032C3 /* whisper.cpp */; settings = {COMPILER_FLAGS = "-Wno-shorten-64-to-32"; }; };
20
+ 0AAC5DCC29539EB1003032C3 /* ggml.c in Sources */ = {isa = PBXBuildFile; fileRef = 0AAC5DC929539EB0003032C3 /* ggml.c */; settings = {COMPILER_FLAGS = "-DGGML_USE_ACCELERATE -Wno-shorten-64-to-32"; }; };
21
+ 0AAC5DCE2953A05C003032C3 /* WhisperState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAC5DCD2953A05C003032C3 /* WhisperState.swift */; };
22
+ 0AAC5DD12953A394003032C3 /* LibWhisper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAC5DD02953A394003032C3 /* LibWhisper.swift */; };
23
+ /* End PBXBuildFile section */
24
+
25
+ /* Begin PBXFileReference section */
26
+ 0A8E48FF2954B3F100704C1B /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
27
+ 0AA751462953AC2E001EE061 /* samples */ = {isa = PBXFileReference; lastKnownFileType = folder; path = samples; sourceTree = "<group>"; };
28
+ 0AA751472953AC2E001EE061 /* models */ = {isa = PBXFileReference; lastKnownFileType = folder; path = models; sourceTree = "<group>"; };
29
+ 0AA7514B2953B569001EE061 /* RiffWaveUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RiffWaveUtils.swift; sourceTree = "<group>"; };
30
+ 0AA7514D2953D958001EE061 /* Recorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Recorder.swift; sourceTree = "<group>"; };
31
+ 0AAC5D9729539CCF003032C3 /* whisper.swiftui.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = whisper.swiftui.app; sourceTree = BUILT_PRODUCTS_DIR; };
32
+ 0AAC5D9A29539CCF003032C3 /* WhisperCppDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhisperCppDemoApp.swift; sourceTree = "<group>"; };
33
+ 0AAC5D9C29539CCF003032C3 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
34
+ 0AAC5D9E29539CD0003032C3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
35
+ 0AAC5DA029539CD0003032C3 /* WhisperCppDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WhisperCppDemo.entitlements; sourceTree = "<group>"; };
36
+ 0AAC5DA229539CD0003032C3 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
37
+ 0AAC5DC629539EAF003032C3 /* WhisperCppDemo-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WhisperCppDemo-Bridging-Header.h"; sourceTree = "<group>"; };
38
+ 0AAC5DC729539EB0003032C3 /* whisper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = whisper.cpp; path = ../../../whisper.cpp; sourceTree = "<group>"; };
39
+ 0AAC5DC829539EB0003032C3 /* whisper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = whisper.h; path = ../../../whisper.h; sourceTree = "<group>"; };
40
+ 0AAC5DC929539EB0003032C3 /* ggml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ggml.c; path = ../../../ggml.c; sourceTree = "<group>"; };
41
+ 0AAC5DCA29539EB0003032C3 /* ggml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ggml.h; path = ../../../ggml.h; sourceTree = "<group>"; };
42
+ 0AAC5DCD2953A05C003032C3 /* WhisperState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhisperState.swift; sourceTree = "<group>"; };
43
+ 0AAC5DD02953A394003032C3 /* LibWhisper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibWhisper.swift; sourceTree = "<group>"; };
44
+ /* End PBXFileReference section */
45
+
46
+ /* Begin PBXFrameworksBuildPhase section */
47
+ 0AAC5D9429539CCF003032C3 /* Frameworks */ = {
48
+ isa = PBXFrameworksBuildPhase;
49
+ buildActionMask = 2147483647;
50
+ files = (
51
+ );
52
+ runOnlyForDeploymentPostprocessing = 0;
53
+ };
54
+ /* End PBXFrameworksBuildPhase section */
55
+
56
+ /* Begin PBXGroup section */
57
+ 0AA7513F2953AB32001EE061 /* Models */ = {
58
+ isa = PBXGroup;
59
+ children = (
60
+ 0AAC5DCD2953A05C003032C3 /* WhisperState.swift */,
61
+ );
62
+ path = Models;
63
+ sourceTree = "<group>";
64
+ };
65
+ 0AA751402953ABA6001EE061 /* Resources */ = {
66
+ isa = PBXGroup;
67
+ children = (
68
+ 0AA751472953AC2E001EE061 /* models */,
69
+ 0AA751462953AC2E001EE061 /* samples */,
70
+ );
71
+ path = Resources;
72
+ sourceTree = "<group>";
73
+ };
74
+ 0AA7514A2953B561001EE061 /* Utils */ = {
75
+ isa = PBXGroup;
76
+ children = (
77
+ 0AA7514B2953B569001EE061 /* RiffWaveUtils.swift */,
78
+ 0AA7514D2953D958001EE061 /* Recorder.swift */,
79
+ );
80
+ path = Utils;
81
+ sourceTree = "<group>";
82
+ };
83
+ 0AAC5D8E29539CCF003032C3 = {
84
+ isa = PBXGroup;
85
+ children = (
86
+ 0A8E48FF2954B3F100704C1B /* README.md */,
87
+ 0AAC5DC529539E89003032C3 /* whisper.cpp */,
88
+ 0AAC5DCF2953A36C003032C3 /* whisper.cpp.swift */,
89
+ 0AAC5D9929539CCF003032C3 /* whisper.swiftui.demo */,
90
+ 0AAC5D9829539CCF003032C3 /* Products */,
91
+ );
92
+ sourceTree = "<group>";
93
+ };
94
+ 0AAC5D9829539CCF003032C3 /* Products */ = {
95
+ isa = PBXGroup;
96
+ children = (
97
+ 0AAC5D9729539CCF003032C3 /* whisper.swiftui.app */,
98
+ );
99
+ name = Products;
100
+ sourceTree = "<group>";
101
+ };
102
+ 0AAC5D9929539CCF003032C3 /* whisper.swiftui.demo */ = {
103
+ isa = PBXGroup;
104
+ children = (
105
+ 0AA7514A2953B561001EE061 /* Utils */,
106
+ 0AA751402953ABA6001EE061 /* Resources */,
107
+ 0AA7513F2953AB32001EE061 /* Models */,
108
+ 0AAC5DD32953A9ED003032C3 /* Supporting files */,
109
+ 0AAC5DD22953A9E3003032C3 /* UI */,
110
+ 0AAC5D9A29539CCF003032C3 /* WhisperCppDemoApp.swift */,
111
+ );
112
+ path = whisper.swiftui.demo;
113
+ sourceTree = "<group>";
114
+ };
115
+ 0AAC5DA129539CD0003032C3 /* Preview Content */ = {
116
+ isa = PBXGroup;
117
+ children = (
118
+ 0AAC5DA229539CD0003032C3 /* Preview Assets.xcassets */,
119
+ );
120
+ name = "Preview Content";
121
+ path = "../Preview Content";
122
+ sourceTree = "<group>";
123
+ };
124
+ 0AAC5DC529539E89003032C3 /* whisper.cpp */ = {
125
+ isa = PBXGroup;
126
+ children = (
127
+ 0AAC5DC929539EB0003032C3 /* ggml.c */,
128
+ 0AAC5DCA29539EB0003032C3 /* ggml.h */,
129
+ 0AAC5DC729539EB0003032C3 /* whisper.cpp */,
130
+ 0AAC5DC829539EB0003032C3 /* whisper.h */,
131
+ );
132
+ path = whisper.cpp;
133
+ sourceTree = "<group>";
134
+ };
135
+ 0AAC5DCF2953A36C003032C3 /* whisper.cpp.swift */ = {
136
+ isa = PBXGroup;
137
+ children = (
138
+ 0AAC5DC629539EAF003032C3 /* WhisperCppDemo-Bridging-Header.h */,
139
+ 0AAC5DD02953A394003032C3 /* LibWhisper.swift */,
140
+ );
141
+ path = whisper.cpp.swift;
142
+ sourceTree = "<group>";
143
+ };
144
+ 0AAC5DD22953A9E3003032C3 /* UI */ = {
145
+ isa = PBXGroup;
146
+ children = (
147
+ 0AAC5D9C29539CCF003032C3 /* ContentView.swift */,
148
+ );
149
+ path = UI;
150
+ sourceTree = "<group>";
151
+ };
152
+ 0AAC5DD32953A9ED003032C3 /* Supporting files */ = {
153
+ isa = PBXGroup;
154
+ children = (
155
+ 0AAC5D9E29539CD0003032C3 /* Assets.xcassets */,
156
+ 0AAC5DA029539CD0003032C3 /* WhisperCppDemo.entitlements */,
157
+ 0AAC5DA129539CD0003032C3 /* Preview Content */,
158
+ );
159
+ path = "Supporting files";
160
+ sourceTree = "<group>";
161
+ };
162
+ /* End PBXGroup section */
163
+
164
+ /* Begin PBXNativeTarget section */
165
+ 0AAC5D9629539CCF003032C3 /* whisper.swiftui */ = {
166
+ isa = PBXNativeTarget;
167
+ buildConfigurationList = 0AAC5DBC29539CD0003032C3 /* Build configuration list for PBXNativeTarget "whisper.swiftui" */;
168
+ buildPhases = (
169
+ 0AAC5D9329539CCF003032C3 /* Sources */,
170
+ 0AAC5D9429539CCF003032C3 /* Frameworks */,
171
+ 0AAC5D9529539CCF003032C3 /* Resources */,
172
+ );
173
+ buildRules = (
174
+ );
175
+ dependencies = (
176
+ );
177
+ name = whisper.swiftui;
178
+ productName = WhisperCppDemo;
179
+ productReference = 0AAC5D9729539CCF003032C3 /* whisper.swiftui.app */;
180
+ productType = "com.apple.product-type.application";
181
+ };
182
+ /* End PBXNativeTarget section */
183
+
184
+ /* Begin PBXProject section */
185
+ 0AAC5D8F29539CCF003032C3 /* Project object */ = {
186
+ isa = PBXProject;
187
+ attributes = {
188
+ BuildIndependentTargetsInParallel = 1;
189
+ LastSwiftUpdateCheck = 1410;
190
+ LastUpgradeCheck = 1410;
191
+ TargetAttributes = {
192
+ 0AAC5D9629539CCF003032C3 = {
193
+ CreatedOnToolsVersion = 14.1;
194
+ LastSwiftMigration = 1410;
195
+ };
196
+ };
197
+ };
198
+ buildConfigurationList = 0AAC5D9229539CCF003032C3 /* Build configuration list for PBXProject "whisper.swiftui" */;
199
+ compatibilityVersion = "Xcode 14.0";
200
+ developmentRegion = en;
201
+ hasScannedForEncodings = 0;
202
+ knownRegions = (
203
+ en,
204
+ Base,
205
+ );
206
+ mainGroup = 0AAC5D8E29539CCF003032C3;
207
+ productRefGroup = 0AAC5D9829539CCF003032C3 /* Products */;
208
+ projectDirPath = "";
209
+ projectRoot = "";
210
+ targets = (
211
+ 0AAC5D9629539CCF003032C3 /* whisper.swiftui */,
212
+ );
213
+ };
214
+ /* End PBXProject section */
215
+
216
+ /* Begin PBXResourcesBuildPhase section */
217
+ 0AAC5D9529539CCF003032C3 /* Resources */ = {
218
+ isa = PBXResourcesBuildPhase;
219
+ buildActionMask = 2147483647;
220
+ files = (
221
+ 0AA751482953AC2E001EE061 /* samples in Resources */,
222
+ 0AAC5DA329539CD0003032C3 /* Preview Assets.xcassets in Resources */,
223
+ 0A8E49002954B3F100704C1B /* README.md in Resources */,
224
+ 0AA751492953AC2E001EE061 /* models in Resources */,
225
+ 0AAC5D9F29539CD0003032C3 /* Assets.xcassets in Resources */,
226
+ );
227
+ runOnlyForDeploymentPostprocessing = 0;
228
+ };
229
+ /* End PBXResourcesBuildPhase section */
230
+
231
+ /* Begin PBXSourcesBuildPhase section */
232
+ 0AAC5D9329539CCF003032C3 /* Sources */ = {
233
+ isa = PBXSourcesBuildPhase;
234
+ buildActionMask = 2147483647;
235
+ files = (
236
+ 0AAC5D9D29539CCF003032C3 /* ContentView.swift in Sources */,
237
+ 0AAC5D9B29539CCF003032C3 /* WhisperCppDemoApp.swift in Sources */,
238
+ 0AAC5DCC29539EB1003032C3 /* ggml.c in Sources */,
239
+ 0AAC5DCE2953A05C003032C3 /* WhisperState.swift in Sources */,
240
+ 0AAC5DD12953A394003032C3 /* LibWhisper.swift in Sources */,
241
+ 0AA7514C2953B569001EE061 /* RiffWaveUtils.swift in Sources */,
242
+ 0AAC5DCB29539EB1003032C3 /* whisper.cpp in Sources */,
243
+ 0AA7514E2953D958001EE061 /* Recorder.swift in Sources */,
244
+ );
245
+ runOnlyForDeploymentPostprocessing = 0;
246
+ };
247
+ /* End PBXSourcesBuildPhase section */
248
+
249
+ /* Begin XCBuildConfiguration section */
250
+ 0AAC5DBA29539CD0003032C3 /* Debug */ = {
251
+ isa = XCBuildConfiguration;
252
+ buildSettings = {
253
+ ALWAYS_SEARCH_USER_PATHS = NO;
254
+ CLANG_ANALYZER_NONNULL = YES;
255
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
256
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
257
+ CLANG_ENABLE_MODULES = YES;
258
+ CLANG_ENABLE_OBJC_ARC = YES;
259
+ CLANG_ENABLE_OBJC_WEAK = YES;
260
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
261
+ CLANG_WARN_BOOL_CONVERSION = YES;
262
+ CLANG_WARN_COMMA = YES;
263
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
264
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
265
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
266
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
267
+ CLANG_WARN_EMPTY_BODY = YES;
268
+ CLANG_WARN_ENUM_CONVERSION = YES;
269
+ CLANG_WARN_INFINITE_RECURSION = YES;
270
+ CLANG_WARN_INT_CONVERSION = YES;
271
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
272
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
273
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
274
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
275
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
276
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
277
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
278
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
279
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
280
+ CLANG_WARN_UNREACHABLE_CODE = YES;
281
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
282
+ COPY_PHASE_STRIP = NO;
283
+ DEBUG_INFORMATION_FORMAT = dwarf;
284
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
285
+ ENABLE_TESTABILITY = YES;
286
+ GCC_C_LANGUAGE_STANDARD = gnu11;
287
+ GCC_DYNAMIC_NO_PIC = NO;
288
+ GCC_NO_COMMON_BLOCKS = YES;
289
+ GCC_OPTIMIZATION_LEVEL = 0;
290
+ GCC_PREPROCESSOR_DEFINITIONS = (
291
+ "DEBUG=1",
292
+ "$(inherited)",
293
+ );
294
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
295
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
296
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
297
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
298
+ GCC_WARN_UNUSED_FUNCTION = YES;
299
+ GCC_WARN_UNUSED_VARIABLE = YES;
300
+ INFOPLIST_KEY_NSMicrophoneUsageDescription = "Needed to transcribe audio";
301
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
302
+ MTL_FAST_MATH = YES;
303
+ ONLY_ACTIVE_ARCH = YES;
304
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
305
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
306
+ };
307
+ name = Debug;
308
+ };
309
+ 0AAC5DBB29539CD0003032C3 /* Release */ = {
310
+ isa = XCBuildConfiguration;
311
+ buildSettings = {
312
+ ALWAYS_SEARCH_USER_PATHS = NO;
313
+ CLANG_ANALYZER_NONNULL = YES;
314
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
315
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
316
+ CLANG_ENABLE_MODULES = YES;
317
+ CLANG_ENABLE_OBJC_ARC = YES;
318
+ CLANG_ENABLE_OBJC_WEAK = YES;
319
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
320
+ CLANG_WARN_BOOL_CONVERSION = YES;
321
+ CLANG_WARN_COMMA = YES;
322
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
323
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
324
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
325
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
326
+ CLANG_WARN_EMPTY_BODY = YES;
327
+ CLANG_WARN_ENUM_CONVERSION = YES;
328
+ CLANG_WARN_INFINITE_RECURSION = YES;
329
+ CLANG_WARN_INT_CONVERSION = YES;
330
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
331
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
332
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
333
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
334
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
335
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
336
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
337
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
338
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
339
+ CLANG_WARN_UNREACHABLE_CODE = YES;
340
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
341
+ COPY_PHASE_STRIP = NO;
342
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
343
+ ENABLE_NS_ASSERTIONS = NO;
344
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
345
+ GCC_C_LANGUAGE_STANDARD = gnu11;
346
+ GCC_NO_COMMON_BLOCKS = YES;
347
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
348
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
349
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
350
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
351
+ GCC_WARN_UNUSED_FUNCTION = YES;
352
+ GCC_WARN_UNUSED_VARIABLE = YES;
353
+ INFOPLIST_KEY_NSMicrophoneUsageDescription = "Needed to transcribe audio";
354
+ MTL_ENABLE_DEBUG_INFO = NO;
355
+ MTL_FAST_MATH = YES;
356
+ SWIFT_COMPILATION_MODE = wholemodule;
357
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
358
+ };
359
+ name = Release;
360
+ };
361
+ 0AAC5DBD29539CD0003032C3 /* Debug */ = {
362
+ isa = XCBuildConfiguration;
363
+ buildSettings = {
364
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
365
+ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
366
+ CLANG_ENABLE_MODULES = YES;
367
+ CODE_SIGN_ENTITLEMENTS = "whisper.swiftui.demo/Supporting files/WhisperCppDemo.entitlements";
368
+ CODE_SIGN_STYLE = Automatic;
369
+ CURRENT_PROJECT_VERSION = 1;
370
+ DEVELOPMENT_ASSET_PATHS = "\"whisper.swiftui.demo/Supporting files/Preview Content\"";
371
+ DEVELOPMENT_TEAM = 3TZ9BM962G;
372
+ ENABLE_HARDENED_RUNTIME = YES;
373
+ ENABLE_PREVIEWS = YES;
374
+ GENERATE_INFOPLIST_FILE = YES;
375
+ "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
376
+ "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
377
+ "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
378
+ "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES;
379
+ "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES;
380
+ "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES;
381
+ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault;
382
+ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
383
+ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
384
+ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
385
+ IPHONEOS_DEPLOYMENT_TARGET = 16.1;
386
+ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
387
+ "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
388
+ MACOSX_DEPLOYMENT_TARGET = 13.0;
389
+ MARKETING_VERSION = 1.0;
390
+ PRODUCT_BUNDLE_IDENTIFIER = com.whispercppdemo.WhisperCppDemo;
391
+ PRODUCT_NAME = "$(TARGET_NAME)";
392
+ SDKROOT = auto;
393
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
394
+ SWIFT_EMIT_LOC_STRINGS = YES;
395
+ SWIFT_OBJC_BRIDGING_HEADER = "whisper.cpp.swift/WhisperCppDemo-Bridging-Header.h";
396
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
397
+ SWIFT_VERSION = 5.0;
398
+ TARGETED_DEVICE_FAMILY = "1,2";
399
+ };
400
+ name = Debug;
401
+ };
402
+ 0AAC5DBE29539CD0003032C3 /* Release */ = {
403
+ isa = XCBuildConfiguration;
404
+ buildSettings = {
405
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
406
+ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
407
+ CLANG_ENABLE_MODULES = YES;
408
+ CODE_SIGN_ENTITLEMENTS = "whisper.swiftui.demo/Supporting files/WhisperCppDemo.entitlements";
409
+ CODE_SIGN_STYLE = Automatic;
410
+ CURRENT_PROJECT_VERSION = 1;
411
+ DEVELOPMENT_ASSET_PATHS = "\"whisper.swiftui.demo/Supporting files/Preview Content\"";
412
+ DEVELOPMENT_TEAM = 3TZ9BM962G;
413
+ ENABLE_HARDENED_RUNTIME = YES;
414
+ ENABLE_PREVIEWS = YES;
415
+ GENERATE_INFOPLIST_FILE = YES;
416
+ "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
417
+ "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
418
+ "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
419
+ "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES;
420
+ "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES;
421
+ "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES;
422
+ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault;
423
+ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
424
+ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
425
+ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
426
+ IPHONEOS_DEPLOYMENT_TARGET = 16.1;
427
+ LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
428
+ "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
429
+ LLVM_LTO = YES;
430
+ MACOSX_DEPLOYMENT_TARGET = 13.0;
431
+ MARKETING_VERSION = 1.0;
432
+ PRODUCT_BUNDLE_IDENTIFIER = com.whispercppdemo.WhisperCppDemo;
433
+ PRODUCT_NAME = "$(TARGET_NAME)";
434
+ SDKROOT = auto;
435
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx";
436
+ SWIFT_EMIT_LOC_STRINGS = YES;
437
+ SWIFT_OBJC_BRIDGING_HEADER = "whisper.cpp.swift/WhisperCppDemo-Bridging-Header.h";
438
+ SWIFT_VERSION = 5.0;
439
+ TARGETED_DEVICE_FAMILY = "1,2";
440
+ };
441
+ name = Release;
442
+ };
443
+ /* End XCBuildConfiguration section */
444
+
445
+ /* Begin XCConfigurationList section */
446
+ 0AAC5D9229539CCF003032C3 /* Build configuration list for PBXProject "whisper.swiftui" */ = {
447
+ isa = XCConfigurationList;
448
+ buildConfigurations = (
449
+ 0AAC5DBA29539CD0003032C3 /* Debug */,
450
+ 0AAC5DBB29539CD0003032C3 /* Release */,
451
+ );
452
+ defaultConfigurationIsVisible = 0;
453
+ defaultConfigurationName = Release;
454
+ };
455
+ 0AAC5DBC29539CD0003032C3 /* Build configuration list for PBXNativeTarget "whisper.swiftui" */ = {
456
+ isa = XCConfigurationList;
457
+ buildConfigurations = (
458
+ 0AAC5DBD29539CD0003032C3 /* Debug */,
459
+ 0AAC5DBE29539CD0003032C3 /* Release */,
460
+ );
461
+ defaultConfigurationIsVisible = 0;
462
+ defaultConfigurationName = Release;
463
+ };
464
+ /* End XCConfigurationList section */
465
+ };
466
+ rootObject = 0AAC5D8F29539CCF003032C3 /* Project object */;
467
+ }
examples/whisper.swiftui/whisper.swiftui.xcodeproj/project.xcworkspace/.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ contents.xcworkspacedata
examples/whisper.swiftui/whisper.swiftui.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
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
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
examples/whisper.swiftui/whisper.swiftui.xcodeproj/xcshareddata/xcschemes/WhisperCppDemo.xcscheme ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "1410"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "0AAC5D9629539CCF003032C3"
18
+ BuildableName = "whisper.swiftui.app"
19
+ BlueprintName = "whisper.swiftui"
20
+ ReferencedContainer = "container:whisper.swiftui.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ buildConfiguration = "Debug"
27
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+ shouldUseLaunchSchemeArgsEnv = "YES">
30
+ <Testables>
31
+ <TestableReference
32
+ skipped = "NO"
33
+ parallelizable = "YES">
34
+ <BuildableReference
35
+ BuildableIdentifier = "primary"
36
+ BlueprintIdentifier = "0AAC5DA729539CD0003032C3"
37
+ BuildableName = "whisper.swiftuiTests.xctest"
38
+ BlueprintName = "whisper.swiftuiTests"
39
+ ReferencedContainer = "container:whisper.swiftui.xcodeproj">
40
+ </BuildableReference>
41
+ </TestableReference>
42
+ <TestableReference
43
+ skipped = "NO"
44
+ parallelizable = "YES">
45
+ <BuildableReference
46
+ BuildableIdentifier = "primary"
47
+ BlueprintIdentifier = "0AAC5DB129539CD0003032C3"
48
+ BuildableName = "whisper.swiftuiUITests.xctest"
49
+ BlueprintName = "whisper.swiftuiUITests"
50
+ ReferencedContainer = "container:whisper.swiftui.xcodeproj">
51
+ </BuildableReference>
52
+ </TestableReference>
53
+ </Testables>
54
+ </TestAction>
55
+ <LaunchAction
56
+ buildConfiguration = "Release"
57
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
58
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59
+ launchStyle = "0"
60
+ useCustomWorkingDirectory = "NO"
61
+ ignoresPersistentStateOnLaunch = "NO"
62
+ debugDocumentVersioning = "YES"
63
+ debugServiceExtension = "internal"
64
+ allowLocationSimulation = "YES">
65
+ <BuildableProductRunnable
66
+ runnableDebuggingMode = "0">
67
+ <BuildableReference
68
+ BuildableIdentifier = "primary"
69
+ BlueprintIdentifier = "0AAC5D9629539CCF003032C3"
70
+ BuildableName = "whisper.swiftui.app"
71
+ BlueprintName = "whisper.swiftui"
72
+ ReferencedContainer = "container:whisper.swiftui.xcodeproj">
73
+ </BuildableReference>
74
+ </BuildableProductRunnable>
75
+ </LaunchAction>
76
+ <ProfileAction
77
+ buildConfiguration = "Release"
78
+ shouldUseLaunchSchemeArgsEnv = "YES"
79
+ savedToolIdentifier = ""
80
+ useCustomWorkingDirectory = "NO"
81
+ debugDocumentVersioning = "YES">
82
+ <BuildableProductRunnable
83
+ runnableDebuggingMode = "0">
84
+ <BuildableReference
85
+ BuildableIdentifier = "primary"
86
+ BlueprintIdentifier = "0AAC5D9629539CCF003032C3"
87
+ BuildableName = "whisper.swiftui.app"
88
+ BlueprintName = "whisper.swiftui"
89
+ ReferencedContainer = "container:whisper.swiftui.xcodeproj">
90
+ </BuildableReference>
91
+ </BuildableProductRunnable>
92
+ </ProfileAction>
93
+ <AnalyzeAction
94
+ buildConfiguration = "Debug">
95
+ </AnalyzeAction>
96
+ <ArchiveAction
97
+ buildConfiguration = "Release"
98
+ revealArchiveInOrganizer = "YES">
99
+ </ArchiveAction>
100
+ </Scheme>