Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS interrupt fix #35

Merged
merged 7 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {

implementation 'ai.picovoice:android-voice-processor:1.0.2'
implementation 'ai.picovoice:porcupine-android:3.0.1'
implementation 'ai.picovoice:cheetah-android:2.0.0'
implementation 'ai.picovoice:cheetah-android:2.1.0'
implementation 'ai.picovoice:picollm-android:1.2.3'
implementation 'ai.picovoice:orca-android:1.0.0'
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
02A1194B268D39A700A2AC99 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1194A268D39A700A2AC99 /* ContentView.swift */; };
02A1194D268D39AB00A2AC99 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 02A1194C268D39AB00A2AC99 /* Assets.xcassets */; };
02A1195F268D3FD600A2AC99 /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A1195E268D3FD600A2AC99 /* ViewModel.swift */; };
A3FB5D9F86DC48A026E79742 /* libPods-LLMVoiceAssistantDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8116446C19FDC139F2B56F5C /* libPods-LLMVoiceAssistantDemo.a */; };
34C504D02D271C5E0003405B /* ios_voice_processor in Frameworks */ = {isa = PBXBuildFile; productRef = 34C504CF2D271C5E0003405B /* ios_voice_processor */; };
34C504D32D271E4B0003405B /* ios_voice_processor in Frameworks */ = {isa = PBXBuildFile; productRef = 34C504D22D271E4B0003405B /* ios_voice_processor */; };
34C504D62D2728300003405B /* Porcupine in Frameworks */ = {isa = PBXBuildFile; productRef = 34C504D52D2728300003405B /* Porcupine */; };
34C504D82D2728410003405B /* Cheetah in Frameworks */ = {isa = PBXBuildFile; productRef = 34C504D72D2728410003405B /* Cheetah */; };
34CE2DE22D27286800AC10F0 /* PicoLLM in Frameworks */ = {isa = PBXBuildFile; productRef = 34CE2DE12D27286800AC10F0 /* PicoLLM */; };
34CE2DE42D27287900AC10F0 /* Orca in Frameworks */ = {isa = PBXBuildFile; productRef = 34CE2DE32D27287900AC10F0 /* Orca */; };
C789D24B2BEA8E5D005FDB10 /* LoadModelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C789D24A2BEA8E5D005FDB10 /* LoadModelView.swift */; };
C789D24D2BEA8EAE005FDB10 /* ChatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C789D24C2BEA8EAE005FDB10 /* ChatView.swift */; };
C789D2512BEAD752005FDB10 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C789D2502BEAD752005FDB10 /* Constants.swift */; };
Expand All @@ -27,9 +32,6 @@
02A1194C268D39AB00A2AC99 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
02A11951268D39AB00A2AC99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
02A1195E268D3FD600A2AC99 /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = "<group>"; };
42D19EE4769392460A93BB89 /* Pods-LLMVoiceAssistantDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LLMVoiceAssistantDemo.release.xcconfig"; path = "Target Support Files/Pods-LLMVoiceAssistantDemo/Pods-LLMVoiceAssistantDemo.release.xcconfig"; sourceTree = "<group>"; };
505D746A281AD13F6F6D5D11 /* Pods-LLMVoiceAssistantDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LLMVoiceAssistantDemo.debug.xcconfig"; path = "Target Support Files/Pods-LLMVoiceAssistantDemo/Pods-LLMVoiceAssistantDemo.debug.xcconfig"; sourceTree = "<group>"; };
8116446C19FDC139F2B56F5C /* libPods-LLMVoiceAssistantDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LLMVoiceAssistantDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
C789D24A2BEA8E5D005FDB10 /* LoadModelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadModelView.swift; sourceTree = "<group>"; };
C789D24C2BEA8EAE005FDB10 /* ChatView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatView.swift; sourceTree = "<group>"; };
C789D2502BEAD752005FDB10 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
Expand All @@ -43,7 +45,12 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A3FB5D9F86DC48A026E79742 /* libPods-LLMVoiceAssistantDemo.a in Frameworks */,
34CE2DE22D27286800AC10F0 /* PicoLLM in Frameworks */,
34C504D62D2728300003405B /* Porcupine in Frameworks */,
34C504D82D2728410003405B /* Cheetah in Frameworks */,
34CE2DE42D27287900AC10F0 /* Orca in Frameworks */,
34C504D32D271E4B0003405B /* ios_voice_processor in Frameworks */,
34C504D02D271C5E0003405B /* ios_voice_processor in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -55,8 +62,6 @@
children = (
02A11947268D39A700A2AC99 /* LLMVoiceAssistantDemo */,
02A11946268D39A700A2AC99 /* Products */,
8DB92FF3DC81AB04D3FF7242 /* Pods */,
E6585D6045A189966C133BD8 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -85,15 +90,6 @@
path = LLMVoiceAssistantDemo;
sourceTree = "<group>";
};
8DB92FF3DC81AB04D3FF7242 /* Pods */ = {
isa = PBXGroup;
children = (
505D746A281AD13F6F6D5D11 /* Pods-LLMVoiceAssistantDemo.debug.xcconfig */,
42D19EE4769392460A93BB89 /* Pods-LLMVoiceAssistantDemo.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
C7E87DC02C07C65C00C32367 /* resources */ = {
isa = PBXGroup;
children = (
Expand All @@ -103,27 +99,16 @@
path = resources;
sourceTree = "<group>";
};
E6585D6045A189966C133BD8 /* Frameworks */ = {
isa = PBXGroup;
children = (
8116446C19FDC139F2B56F5C /* libPods-LLMVoiceAssistantDemo.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
02A11944268D39A700A2AC99 /* LLMVoiceAssistantDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 02A11954268D39AB00A2AC99 /* Build configuration list for PBXNativeTarget "LLMVoiceAssistantDemo" */;
buildPhases = (
C54BB0EBC41CA3C7A3CD997F /* [CP] Check Pods Manifest.lock */,
02A11941268D39A700A2AC99 /* Sources */,
02A11942268D39A700A2AC99 /* Frameworks */,
02A11943268D39A700A2AC99 /* Resources */,
466DD26F1FA12E383AC5E702 /* [CP] Embed Pods Frameworks */,
ABFE6A8B8F163462392CE190 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -158,6 +143,13 @@
Base,
);
mainGroup = 02A1193C268D39A700A2AC99;
packageReferences = (
34C504CB2D2719480003405B /* XCRemoteSwiftPackageReference "porcupine" */,
34C504CC2D2719A30003405B /* XCRemoteSwiftPackageReference "orca" */,
34C504CD2D271A440003405B /* XCRemoteSwiftPackageReference "cheetah" */,
34C504D12D271E4B0003405B /* XCRemoteSwiftPackageReference "ios-voice-processor" */,
34C504D42D271E6B0003405B /* XCRemoteSwiftPackageReference "picollm" */,
);
productRefGroup = 02A11946268D39A700A2AC99 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand All @@ -180,65 +172,6 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
466DD26F1FA12E383AC5E702 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LLMVoiceAssistantDemo/Pods-LLMVoiceAssistantDemo-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LLMVoiceAssistantDemo/Pods-LLMVoiceAssistantDemo-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LLMVoiceAssistantDemo/Pods-LLMVoiceAssistantDemo-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
ABFE6A8B8F163462392CE190 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LLMVoiceAssistantDemo/Pods-LLMVoiceAssistantDemo-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LLMVoiceAssistantDemo/Pods-LLMVoiceAssistantDemo-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LLMVoiceAssistantDemo/Pods-LLMVoiceAssistantDemo-resources.sh\"\n";
showEnvVarsInLog = 0;
};
C54BB0EBC41CA3C7A3CD997F /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-LLMVoiceAssistantDemo-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
02A11941268D39A700A2AC99 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -377,7 +310,6 @@
};
02A11955268D39AB00A2AC99 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 505D746A281AD13F6F6D5D11 /* Pods-LLMVoiceAssistantDemo.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand All @@ -401,7 +333,6 @@
};
02A11956268D39AB00A2AC99 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 42D19EE4769392460A93BB89 /* Pods-LLMVoiceAssistantDemo.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down Expand Up @@ -445,6 +376,90 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
34C504CB2D2719480003405B /* XCRemoteSwiftPackageReference "porcupine" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/picovoice/porcupine";
requirement = {
kind = exactVersion;
version = 3.0.4;
};
};
34C504CC2D2719A30003405B /* XCRemoteSwiftPackageReference "orca" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/picovoice/orca";
requirement = {
kind = exactVersion;
version = 1.0.1;
};
};
34C504CD2D271A440003405B /* XCRemoteSwiftPackageReference "cheetah" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/picovoice/cheetah";
requirement = {
kind = exactVersion;
version = 2.1.0;
};
};
34C504CE2D271C5E0003405B /* XCRemoteSwiftPackageReference "ios-voice-processor" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/picovoice/ios-voice-processor";
requirement = {
kind = exactVersion;
version = 1.2.0;
};
};
34C504D12D271E4B0003405B /* XCRemoteSwiftPackageReference "ios-voice-processor" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/picovoice/ios-voice-processor";
requirement = {
kind = exactVersion;
version = 1.2.0;
};
};
34C504D42D271E6B0003405B /* XCRemoteSwiftPackageReference "picollm" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/picovoice/picollm";
requirement = {
kind = exactVersion;
version = 1.2.4;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
34C504CF2D271C5E0003405B /* ios_voice_processor */ = {
isa = XCSwiftPackageProductDependency;
package = 34C504CE2D271C5E0003405B /* XCRemoteSwiftPackageReference "ios-voice-processor" */;
productName = ios_voice_processor;
};
34C504D22D271E4B0003405B /* ios_voice_processor */ = {
isa = XCSwiftPackageProductDependency;
package = 34C504D12D271E4B0003405B /* XCRemoteSwiftPackageReference "ios-voice-processor" */;
productName = ios_voice_processor;
};
34C504D52D2728300003405B /* Porcupine */ = {
isa = XCSwiftPackageProductDependency;
package = 34C504CB2D2719480003405B /* XCRemoteSwiftPackageReference "porcupine" */;
productName = Porcupine;
};
34C504D72D2728410003405B /* Cheetah */ = {
isa = XCSwiftPackageProductDependency;
package = 34C504CD2D271A440003405B /* XCRemoteSwiftPackageReference "cheetah" */;
productName = Cheetah;
};
34CE2DE12D27286800AC10F0 /* PicoLLM */ = {
isa = XCSwiftPackageProductDependency;
package = 34C504D42D271E6B0003405B /* XCRemoteSwiftPackageReference "picollm" */;
productName = PicoLLM;
};
34CE2DE32D27287900AC10F0 /* Orca */ = {
isa = XCSwiftPackageProductDependency;
package = 34C504CC2D2719A30003405B /* XCRemoteSwiftPackageReference "orca" */;
productName = Orca;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 02A1193D268D39A700A2AC99 /* Project object */;
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,6 @@ class AudioPlayerStream {
func stopStreamPCM() {
isStopped = true
pcmBuffers.removeAll()
playerNode.stop()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Orca
import ios_voice_processor

import Combine
import Foundation

enum ChatState {
case WAKEWORD
Expand Down Expand Up @@ -322,6 +323,7 @@ You can download directly to your device or airdrop from a Mac.
let keywordIndex = try self.porcupine!.process(pcm: frame)
if keywordIndex == 0 {
DispatchQueue.main.async { [self] in
self.interrupt()
statusText = "Listening..."
chatText.append(Message(speaker: "You:", msg: ""))
chatState = .STT
Expand All @@ -346,7 +348,7 @@ You can download directly to your device or airdrop from a Mac.
}
if endpoint {
DispatchQueue.main.async { [self] in
statusText = "Generating, Say `Picovoice` to interrupt"
statusText = "Generating...\nSay `Picovoice` to interrupt"
chatState = .GENERATE
self.generate()
}
Expand Down
Binary file not shown.
10 changes: 0 additions & 10 deletions recipes/llm-voice-assistant/ios/Podfile

This file was deleted.

33 changes: 0 additions & 33 deletions recipes/llm-voice-assistant/ios/Podfile.lock

This file was deleted.

Loading
Loading