From 1a3e1ecb73d69788b97253feac099af7e3a0a4e3 Mon Sep 17 00:00:00 2001 From: Ian Lavery Date: Wed, 22 Nov 2023 12:06:26 -0800 Subject: [PATCH] demo and fixes --- binding/ios/Cheetah.swift | 14 +++++++------- .../CheetahAppTest.xcodeproj/project.pbxproj | 8 ++++---- .../CheetahAppTest/ViewController.swift | 10 ++-------- .../CheetahAppTestUITests.swift | 8 -------- binding/ios/CheetahAppTest/Podfile | 8 ++++---- binding/ios/CheetahAppTest/Podfile.lock | 16 ++++++++-------- demo/ios/CheetahDemo/CheetahDemo/ViewModel.swift | 2 +- demo/ios/CheetahDemo/Podfile | 4 ++-- demo/ios/CheetahDemo/Podfile.lock | 13 ++++++++----- 9 files changed, 36 insertions(+), 47 deletions(-) diff --git a/binding/ios/Cheetah.swift b/binding/ios/Cheetah.swift index 4a519995..b71e02c7 100644 --- a/binding/ios/Cheetah.swift +++ b/binding/ios/Cheetah.swift @@ -124,8 +124,8 @@ public class Cheetah { if pcm.count != Cheetah.frameLength { throw CheetahInvalidArgumentError( - "Frame of audio data must contain \(Cheetah.frameLength) samples - - given frame contained \(pcm.count)") + "Frame of audio data must contain \(Cheetah.frameLength) samples" + + " - given frame contained \(pcm.count)") } var cPartialTranscript: UnsafeMutablePointer? @@ -137,7 +137,7 @@ public class Cheetah { } let transcript = String(cString: cPartialTranscript!) - cPartialTranscript?.deallocate() + pv_cheetah_transcript_delete(cPartialTranscript!) return (transcript, endPoint) } @@ -159,7 +159,7 @@ public class Cheetah { } let transcript = String(cString: cFinalTranscript!) - cFinalTranscript?.deallocate() + pv_cheetah_transcript_delete(cFinalTranscript!) return transcript } @@ -178,12 +178,12 @@ public class Cheetah { } throw CheetahIOError( - "Could not find file at path '\(filePath)'. If this is a packaged asset, - ensure you have added it to your xcode project." + "Could not find file at path '\(filePath)'. If this is a packaged asset, " + + "ensure you have added it to your xcode project." ) } - private func checkStatus( + private func pvStatusToCheetahError( _ status: pv_status_t, _ message: String, _ messageStack: [String] = []) -> CheetahError { diff --git a/binding/ios/CheetahAppTest/CheetahAppTest.xcodeproj/project.pbxproj b/binding/ios/CheetahAppTest/CheetahAppTest.xcodeproj/project.pbxproj index ab90d906..64e50650 100644 --- a/binding/ios/CheetahAppTest/CheetahAppTest.xcodeproj/project.pbxproj +++ b/binding/ios/CheetahAppTest/CheetahAppTest.xcodeproj/project.pbxproj @@ -547,7 +547,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -601,7 +601,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -626,7 +626,7 @@ INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -656,7 +656,7 @@ INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/binding/ios/CheetahAppTest/CheetahAppTest/ViewController.swift b/binding/ios/CheetahAppTest/CheetahAppTest/ViewController.swift index 8e615640..f3776308 100644 --- a/binding/ios/CheetahAppTest/CheetahAppTest/ViewController.swift +++ b/binding/ios/CheetahAppTest/CheetahAppTest/ViewController.swift @@ -1,5 +1,5 @@ // -// Copyright 2022 Picovoice Inc. +// Copyright 2022-2023 Picovoice Inc. // You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" // file accompanying this source. // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on @@ -9,10 +9,4 @@ import UIKit -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - } - -} +class ViewController: UIViewController { } diff --git a/binding/ios/CheetahAppTest/CheetahAppTestUITests/CheetahAppTestUITests.swift b/binding/ios/CheetahAppTest/CheetahAppTestUITests/CheetahAppTestUITests.swift index 3fcf86c2..867fa896 100644 --- a/binding/ios/CheetahAppTest/CheetahAppTestUITests/CheetahAppTestUITests.swift +++ b/binding/ios/CheetahAppTest/CheetahAppTestUITests/CheetahAppTestUITests.swift @@ -19,14 +19,6 @@ class CheetahDemoUITests: XCTestCase { let modelURL = Bundle(for: CheetahDemoUITests.self).url(forResource: "cheetah_params", withExtension: "pv")! - override func setUp() { - super.setUp() - } - - override func tearDown() { - super.tearDown() - } - override func setUpWithError() throws { continueAfterFailure = true } diff --git a/binding/ios/CheetahAppTest/Podfile b/binding/ios/CheetahAppTest/Podfile index f097b7a7..c7aba4e5 100644 --- a/binding/ios/CheetahAppTest/Podfile +++ b/binding/ios/CheetahAppTest/Podfile @@ -1,14 +1,14 @@ source 'https://cdn.cocoapods.org/' -platform :ios, '9.0' +platform :ios, '13.0' target 'CheetahAppTest' do - pod 'Cheetah-iOS', '~> 1.1.0' + pod 'Cheetah-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/cheetah/v2.0-ios/binding/ios/Cheetah-iOS.podspec' end target 'CheetahAppTestUITests' do - pod 'Cheetah-iOS', '~> 1.1.0' + pod 'Cheetah-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/cheetah/v2.0-ios/binding/ios/Cheetah-iOS.podspec' end target 'PerformanceTest' do - pod 'Cheetah-iOS', '~> 1.1.0' + pod 'Cheetah-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/cheetah/v2.0-ios/binding/ios/Cheetah-iOS.podspec' end diff --git a/binding/ios/CheetahAppTest/Podfile.lock b/binding/ios/CheetahAppTest/Podfile.lock index 4fbf2fdd..a16ca7ce 100644 --- a/binding/ios/CheetahAppTest/Podfile.lock +++ b/binding/ios/CheetahAppTest/Podfile.lock @@ -1,16 +1,16 @@ PODS: - - Cheetah-iOS (1.1.0) + - Cheetah-iOS (2.0.0) DEPENDENCIES: - - Cheetah-iOS (~> 1.1.0) + - Cheetah-iOS (from `https://raw.githubusercontent.com/Picovoice/cheetah/v2.0-ios/binding/ios/Cheetah-iOS.podspec`) -SPEC REPOS: - trunk: - - Cheetah-iOS +EXTERNAL SOURCES: + Cheetah-iOS: + :podspec: https://raw.githubusercontent.com/Picovoice/cheetah/v2.0-ios/binding/ios/Cheetah-iOS.podspec SPEC CHECKSUMS: - Cheetah-iOS: 6fb7be693878f5b1dec0ea5b6534fbba30954afc + Cheetah-iOS: d98a5edcbf3b74dda6027aeac6a8c0f5997a47a2 -PODFILE CHECKSUM: be70602bbfa54a30183877dfe83545b7f63d2887 +PODFILE CHECKSUM: 813d31bb6f15922d6ea3eef044c962b3c3c8dfbe -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3 diff --git a/demo/ios/CheetahDemo/CheetahDemo/ViewModel.swift b/demo/ios/CheetahDemo/CheetahDemo/ViewModel.swift index 834a0784..85628e22 100644 --- a/demo/ios/CheetahDemo/CheetahDemo/ViewModel.swift +++ b/demo/ios/CheetahDemo/CheetahDemo/ViewModel.swift @@ -51,7 +51,7 @@ class ViewModel: ObservableObject { state = UIState.READY } catch let error as CheetahInvalidArgumentError { - errorMessage = "\(error.localizedDescription)\nEnsure your AccessKey '\(ACCESS_KEY)' is valid." + errorMessage = "\(error.localizedDescription)" } catch is CheetahActivationError { errorMessage = "ACCESS_KEY activation error" } catch is CheetahActivationRefusedError { diff --git a/demo/ios/CheetahDemo/Podfile b/demo/ios/CheetahDemo/Podfile index 07469de2..56f2a3f4 100644 --- a/demo/ios/CheetahDemo/Podfile +++ b/demo/ios/CheetahDemo/Podfile @@ -1,7 +1,7 @@ source 'https://cdn.cocoapods.org/' -platform :ios, '11.0' +platform :ios, '13.0' target 'CheetahDemo' do - pod 'Cheetah-iOS', '~> 1.1.0' + pod 'Cheetah-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/cheetah/v2.0-ios/binding/ios/Cheetah-iOS.podspec' pod 'ios-voice-processor', '~> 1.1.0' end diff --git a/demo/ios/CheetahDemo/Podfile.lock b/demo/ios/CheetahDemo/Podfile.lock index 56786c9e..dbb1a48f 100644 --- a/demo/ios/CheetahDemo/Podfile.lock +++ b/demo/ios/CheetahDemo/Podfile.lock @@ -1,20 +1,23 @@ PODS: - - Cheetah-iOS (1.1.0) + - Cheetah-iOS (2.0.0) - ios-voice-processor (1.1.0) DEPENDENCIES: - - Cheetah-iOS (~> 1.1.0) + - Cheetah-iOS (from `https://raw.githubusercontent.com/Picovoice/cheetah/v2.0-ios/binding/ios/Cheetah-iOS.podspec`) - ios-voice-processor (~> 1.1.0) SPEC REPOS: trunk: - - Cheetah-iOS - ios-voice-processor +EXTERNAL SOURCES: + Cheetah-iOS: + :podspec: https://raw.githubusercontent.com/Picovoice/cheetah/v2.0-ios/binding/ios/Cheetah-iOS.podspec + SPEC CHECKSUMS: - Cheetah-iOS: 6fb7be693878f5b1dec0ea5b6534fbba30954afc + Cheetah-iOS: d98a5edcbf3b74dda6027aeac6a8c0f5997a47a2 ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1 -PODFILE CHECKSUM: 9b9aa7cee64517773071f86ed45a3b16f8ffddad +PODFILE CHECKSUM: e162593f02a8dbab3949d69a3a9888de0e155a29 COCOAPODS: 1.11.3