Skip to content

Commit

Permalink
demo and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
laves committed Nov 22, 2023
1 parent 8883796 commit 1a3e1ec
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 47 deletions.
14 changes: 7 additions & 7 deletions binding/ios/Cheetah.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Int8>?
Expand All @@ -137,7 +137,7 @@ public class Cheetah {
}

let transcript = String(cString: cPartialTranscript!)
cPartialTranscript?.deallocate()
pv_cheetah_transcript_delete(cPartialTranscript!)

return (transcript, endPoint)
}
Expand All @@ -159,7 +159,7 @@ public class Cheetah {
}

let transcript = String(cString: cFinalTranscript!)
cFinalTranscript?.deallocate()
pv_cheetah_transcript_delete(cFinalTranscript!)

return transcript
}
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
10 changes: 2 additions & 8 deletions binding/ios/CheetahAppTest/CheetahAppTest/ViewController.swift
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,10 +9,4 @@

import UIKit

class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
}

}
class ViewController: UIViewController { }
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions binding/ios/CheetahAppTest/Podfile
Original file line number Diff line number Diff line change
@@ -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
16 changes: 8 additions & 8 deletions binding/ios/CheetahAppTest/Podfile.lock
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion demo/ios/CheetahDemo/CheetahDemo/ViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions demo/ios/CheetahDemo/Podfile
Original file line number Diff line number Diff line change
@@ -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
13 changes: 8 additions & 5 deletions demo/ios/CheetahDemo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1a3e1ec

Please sign in to comment.