diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..2b4c047 Binary files /dev/null and b/.DS_Store differ diff --git a/ListenerGS.xcodeproj/project.pbxproj b/ListenerGS.xcodeproj/project.pbxproj index 9b196ca..890ff17 100644 --- a/ListenerGS.xcodeproj/project.pbxproj +++ b/ListenerGS.xcodeproj/project.pbxproj @@ -601,6 +601,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = com.halcyontouch.ListenerGS; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; @@ -628,6 +629,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = com.halcyontouch.ListenerGS; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTS_MACCATALYST = YES; diff --git a/ListenerGS.xcodeproj/project.xcworkspace/xcuserdata/jrand.xcuserdatad/UserInterfaceState.xcuserstate b/ListenerGS.xcodeproj/project.xcworkspace/xcuserdata/jrand.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..88804e4 Binary files /dev/null and b/ListenerGS.xcodeproj/project.xcworkspace/xcuserdata/jrand.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ListenerGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist b/ListenerGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist index a42e73a..1486bb7 100644 --- a/ListenerGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/ListenerGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist @@ -17,21 +17,6 @@ SuppressBuildableAutocreation - 9D5155EE26A1EF7B0075EBC7 - - primary - - - 9D5155FF26A1EF7C0075EBC7 - - primary - - - 9D51560A26A1EF7C0075EBC7 - - primary - - 9D62FC5F27C494D700AEE01F primary diff --git a/ListenerGS/GSConnection.swift b/ListenerGS/GSConnection.swift index c6c1c94..149c19b 100644 --- a/ListenerGS/GSConnection.swift +++ b/ListenerGS/GSConnection.swift @@ -104,7 +104,7 @@ class GSConnection : ObservableObject { } if (!legalTransition) { - logger.error("Illegal requested state transition from \(oldState) to \(newState)") + logger.error("Illegal requested state transition from \(oldState, privacy: .public) to \(newState, privacy: .public)") errorOccurred(title: "Bad State Change", message: "Illegal state transition from \(oldState) to \(newState)") } else { state = newState @@ -126,14 +126,14 @@ class GSConnection : ObservableObject { private func connectionSuccessful() { changeState(newState:.connected) - logger.debug("Connected to \(self.destination)") + logger.debug("Connected to \(self.destination, privacy: .public)") } func connect(destination : String) { self.destination = destination changeState(newState: .connecting) readQueue.addOperation { [weak self, destination] in - self?.logger.debug("Attempting to connect to \(destination)") + self?.logger.debug("Attempting to connect to \(destination, privacy: .public)") let client = TCPClient(address: destination, port: Int32(GSConnection.port)) switch client.connect(timeout: 10) { case .success: @@ -143,7 +143,7 @@ class GSConnection : ObservableObject { } case .failure(let error): client.close() - self?.logger.error("Failed to connect to \(destination): \(String(describing: error))") + self?.logger.error("Failed to connect to \(destination, privacy: .public): \(String(describing: error), privacy: .public)") self?.mainQueue.addOperation { self?.connectionFailed() } @@ -171,13 +171,13 @@ class GSConnection : ObservableObject { self.trySend() } } else { - self.logger.error("Unexpected message on socket from \(destination)") + self.logger.error("Unexpected message on socket from \(destination, privacy: .public)") self.errorOccurred(title: "Protocol Error", message: "Unexpected message from the GS") break } } catch { - self.logger.error("Unable to unpack message on socket from \(destination)") + self.logger.error("Unable to unpack message on socket from \(destination, privacy: .public)") self.errorOccurred(title: "Protocol Error", message: "Unexpected message from the GS") break } @@ -230,7 +230,7 @@ class GSConnection : ObservableObject { case .success: break case .failure(let error): - self.logger.error("Unable to send header: \(String(describing: error))") + self.logger.error("Unable to send header: \(String(describing: error), privacy: .public)") return false } @@ -319,14 +319,14 @@ class GSConnection : ObservableObject { case .success: switch (client.send(data: bytes)) { case .success: - logger.debug("Sent text \"\(stringToSend)\"") + logger.debug("Sent text \"\(stringToSend, privacy: .public)\"") break case .failure(let error): mainQueue.addOperation { self.errorOccurred(title: "Write Error", message: "Unable to send text to the GS") self.disconnect() } - logger.error("Failed to send text: \(String(describing: error))") + logger.error("Failed to send text: \(String(describing: error), privacy: .public)") return false } case .failure(let error): @@ -334,7 +334,7 @@ class GSConnection : ObservableObject { self.errorOccurred(title: "Write Error", message: "Unable to send text to the GS") self.disconnect() } - logger.error("Failed to send text: \(String(describing: error))") + logger.error("Failed to send text: \(String(describing: error), privacy: .public)") } } return true diff --git a/ListenerGS/Info.plist b/ListenerGS/Info.plist index e4dec6f..ecb41b1 100644 --- a/ListenerGS/Info.plist +++ b/ListenerGS/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.0 + 1.0.1 CFBundleVersion - 794 + 807 LSApplicationCategoryType public.app-category.utilities LSRequiresIPhoneOS diff --git a/ListenerGS/SpeechForwarder.swift b/ListenerGS/SpeechForwarder.swift index da93e98..7f01084 100644 --- a/ListenerGS/SpeechForwarder.swift +++ b/ListenerGS/SpeechForwarder.swift @@ -82,7 +82,7 @@ class SpeechForwarder : SpeechForwarderProtocol { // Configure the microphone input. let inputFormat = inputNode.outputFormat(forBus: 0) let speechFormat = recognitionRequest.nativeAudioFormat - logger.debug("Recording format \(inputFormat), speech format \(speechFormat)") + logger.debug("Recording format \(inputFormat, privacy: .public), speech format \(speechFormat, privacy: .public)") var formatConverter: AVAudioConverter? if (!inputFormat.isEqual(speechFormat)) { formatConverter = AVAudioConverter(from:inputFormat, to: speechFormat) @@ -114,17 +114,17 @@ class SpeechForwarder : SpeechForwarderProtocol { recognitionTask = speechRecognizer.recognitionTask(with: recognitionRequest) { [weak connection] result, error in var isFinal = false - if let result = result { - // Update the text view with the results. - OperationQueue.main.addOperation { - guard let connection = connection else { return } - connection.set(text: result.bestTranscription.formattedString) - } - isFinal = result.isFinal - } - if error != nil { - self.logger.error("Error from recognizer: \(String(describing: error))") + self.logger.error("Error from recognizer: \(String(describing: error), privacy:.public)") + } else if let result = result { + isFinal = result.isFinal + if !isFinal || result.bestTranscription.formattedString != "" { + // Update the text view with the results. + OperationQueue.main.addOperation { + guard let connection = connection else { return } + connection.set(text: result.bestTranscription.formattedString) + } + } } if error != nil || isFinal {