Use SPM in iOS examples - #3822
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR exports the Swift API surface, migrates five iOS SwiftUI projects from embedded XCFrameworks to the sherpa-onnx Swift package, adds explicit module imports, updates one TTS configuration, removes the installed module map after macOS builds, and introduces iOS simulator CI coverage. ChangesiOS Swift Package migration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant Xcode
participant SwiftPackageManager
participant SwiftUIApps
GitHubActions->>Xcode: build five iOS Simulator schemes
Xcode->>SwiftPackageManager: resolve sherpa-onnx product
SwiftPackageManager->>SwiftUIApps: provide SherpaOnnx module
SwiftUIApps->>SwiftUIApps: compile imported API usage
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
swift-api-examples/SherpaOnnx.swift (1)
2208-2218: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick winKeep C string buffers alive for the whole config construction.
withUnsafeBufferPointeronly guarantees the returnedbaseAddressfor the closure execution, but line 2225 passes those cstrings toSherpaOnnxCreateOfflineSourceSeparationafter all buffer closures have returned. Build the pointers in scoped C-string closures and callbody(...)before each buffer/storage is deallocated or overwritten.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@swift-api-examples/SherpaOnnx.swift` around lines 2208 - 2218, Update withCConfig so every C-string pointer remains valid while the configuration is consumed: replace the helper’s escaped baseAddress storage with nested withUnsafeBufferPointer scopes for each optional string, and invoke body (and the underlying SherpaOnnxCreateOfflineSourceSeparation call) inside those scopes. Ensure all related buffers and config storage remain alive through the call, including when optional values are nil.
🧹 Nitpick comments (1)
swift-api-examples/SherpaOnnx.swift (1)
212-212: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid freezing the
Recongitiontypo into the public API.Both exported result classes are misspelled. Add correctly spelled public names before consumers adopt this API, retaining deprecated aliases if compatibility is required.
Also applies to: 677-677
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@swift-api-examples/SherpaOnnx.swift` at line 212, Correct the public class names for both exported recognition result types, including the declaration near SherpaOnnxOnlineRecongitionResult and the corresponding class near the second affected location. Preserve compatibility by retaining the misspelled names only as deprecated aliases that reference the correctly spelled public classes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ios.yaml:
- Around line 27-29: Disable checkout credential persistence by adding
persist-credentials: false to every actions/checkout@v4 step in
.github/workflows/ios.yaml at lines 27-29, 44-46, 61-63, 78-80, and 95-97, while
preserving the existing fetch-depth settings.
- Around line 33-39: Enable pipefail before each piped xcodebuild command so
simulator build failures propagate correctly: update .github/workflows/ios.yaml
lines 33-39, 51-56, 68-73, 85-90, and 102-107, covering the SherpaOnnx,
SherpaOnnx2Pass, SherpaOnnxLangID, SherpaOnnxSubtitle, and SherpaOnnxTts build
steps.
In `@ios-swiftui/SherpaOnnx/SherpaOnnx.xcodeproj/project.pbxproj`:
- Around line 231-233: Add the missing XCRemoteSwiftPackageReference object for
C9SP000000000003, defining the sherpa-onnx repository URL and its required
version or branch, and place it in the project’s PBX object sections so the
existing packageReferences entry and product dependency resolve correctly.
In `@ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass.xcodeproj/project.pbxproj`:
- Around line 130-132: Add a matching XCRemoteSwiftPackageReference object for
package UUID C9SP000000000003 and the sherpa-onnx package in
ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass.xcodeproj/project.pbxproj (lines
130-132),
ios-swiftui/SherpaOnnxLangID/SherpaOnnxLangID.xcodeproj/project.pbxproj (lines
233-235), and
ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle.xcodeproj/project.pbxproj
(lines 160-162). Define each package object with the repository URL and
requirement matching the project’s intended sherpa-onnx dependency so the
existing XCSwiftPackageProductDependency references resolve.
In `@ios-swiftui/SherpaOnnxTts/SherpaOnnxTts.xcodeproj/project.pbxproj`:
- Around line 24-26: Update the Xcode project’s Resources build phase to bundle
the three new TTS assets: espeak-ng-data, en_US-amy-low.onnx, and tokens.txt.
Add corresponding PBXBuildFile entries and include all three build-file
references in C917B4DF2B0EEF3B005245AC /* Resources */, while retaining their
existing PBXFileReference entries.
In `@swift-api-examples/SherpaOnnx.swift`:
- Around line 16-18: Remove the public `toCPointer` API and eliminate its use
for storing string pointers in the public config factories. Use owned string
storage for any pointers retained in C structs, or restrict pointer conversion
to internal immediate C calls where the backing string remains alive; ensure SPM
clients cannot receive pointers backed by a temporary `NSString`.
- Around line 2195-2207: Add public initializers to the nested Spleeter and Uvr
structs and to SourceSeparationConfig, exposing parameters for their
configurable properties with existing defaults preserved. Update
SourceSeparator.init?(config:) to be public so external package clients can
construct and use the source-separation API.
---
Outside diff comments:
In `@swift-api-examples/SherpaOnnx.swift`:
- Around line 2208-2218: Update withCConfig so every C-string pointer remains
valid while the configuration is consumed: replace the helper’s escaped
baseAddress storage with nested withUnsafeBufferPointer scopes for each optional
string, and invoke body (and the underlying
SherpaOnnxCreateOfflineSourceSeparation call) inside those scopes. Ensure all
related buffers and config storage remain alive through the call, including when
optional values are nil.
---
Nitpick comments:
In `@swift-api-examples/SherpaOnnx.swift`:
- Line 212: Correct the public class names for both exported recognition result
types, including the declaration near SherpaOnnxOnlineRecongitionResult and the
corresponding class near the second affected location. Preserve compatibility by
retaining the misspelled names only as deprecated aliases that reference the
correctly spelled public classes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0f7383f8-b814-4e9d-86aa-0f2f8d8ef32e
📒 Files selected for processing (26)
.github/workflows/ios.yamlios-swiftui/.gitignoreios-swiftui/SherpaOnnx/SherpaOnnx.xcodeproj/project.pbxprojios-swiftui/SherpaOnnx/SherpaOnnx/ContentView.swiftios-swiftui/SherpaOnnx/SherpaOnnx/Extension.swiftios-swiftui/SherpaOnnx/SherpaOnnx/Model.swiftios-swiftui/SherpaOnnx/SherpaOnnx/SherpaOnnxApp.swiftios-swiftui/SherpaOnnx/SherpaOnnx/SherpaOnnxViewModel.swiftios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass.xcodeproj/project.pbxprojios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/ContentView.swiftios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/Extension.swiftios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/Model.swiftios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/SherpaOnnx2PassApp.swiftios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/SherpaOnnxViewModel.swiftios-swiftui/SherpaOnnxLangID/SherpaOnnxLangID.xcodeproj/project.pbxprojios-swiftui/SherpaOnnxLangID/SherpaOnnxLangID/ContentView.swiftios-swiftui/SherpaOnnxLangID/SherpaOnnxLangID/SherpaOnnxLangIDApp.swiftios-swiftui/SherpaOnnxLangID/SherpaOnnxLangID/ViewModel.swiftios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle.xcodeproj/project.pbxprojios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/ContentView.swiftios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/SherpaOnnxSubtitleApp.swiftios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/SubtitleViewModel.swiftios-swiftui/SherpaOnnxTts/SherpaOnnxTts.xcodeproj/project.pbxprojios-swiftui/SherpaOnnxTts/SherpaOnnxTts/ContentView.swiftios-swiftui/SherpaOnnxTts/SherpaOnnxTts/ViewModel.swiftswift-api-examples/SherpaOnnx.swift
| C9E3B5CE3019B6D50057554A /* espeak-ng-data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "espeak-ng-data"; sourceTree = "<group>"; }; | ||
| C9E3B5CF3019B6D50057554A /* en_US-amy-low.onnx */ = {isa = PBXFileReference; lastKnownFileType = file; path = "en_US-amy-low.onnx"; sourceTree = "<group>"; }; | ||
| C9E3B5D03019B6D50057554A /* tokens.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = tokens.txt; sourceTree = "<group>"; }; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Bundle the newly added TTS assets.
These are only PBXFileReferences; none are added to the Resources build phase at lines 140-149. Bundle.main cannot load the model, tokens, or espeak-ng-data from the installed app.
Add PBXBuildFile resource entries for all three and include them in C917B4DF2B0EEF3B005245AC /* Resources */.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@ios-swiftui/SherpaOnnxTts/SherpaOnnxTts.xcodeproj/project.pbxproj` around
lines 24 - 26, Update the Xcode project’s Resources build phase to bundle the
three new TTS assets: espeak-ng-data, en_US-amy-low.onnx, and tokens.txt. Add
corresponding PBXBuildFile entries and include all three build-file references
in C917B4DF2B0EEF3B005245AC /* Resources */, while retaining their existing
PBXFileReference entries.
| public func toCPointer(_ s: String) -> UnsafePointer<Int8>! { | ||
| let cs = (s as NSString).utf8String | ||
| return UnsafePointer<Int8>(cs) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | sed -n '1,120p'
echo "== target file context =="
if [ -f swift-api-examples/SherpaOnnx.swift ]; then
wc -l swift-api-examples/SherpaOnnx.swift
ast-grep outline swift-api-examples/SherpaOnnx.swift || true
sed -n '1,140p' swift-api-examples/SherpaOnnx.swift
else
fd -i 'SherpaOnnx.swift'
fi
echo "== search toCPointer and withCConfig usages =="
rg -n "toCPointer|withCConfig|withCString|SwiftManaged" swift-api-examples/SherpaOnnx.swift . --glob '*.swift' --glob '*.h' --glob '*.hpp' | sed -n '1,220p'Repository: k2-fsa/sherpa-onnx
Length of output: 34367
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Swift config structs and call sites =="
sed -n '28,135p' swift-api-examples/SherpaOnnx.swift
sed -n '145,220p' swift-api-examples/SherpaOnnx.swift
sed -n '254,340p' swift-api-examples/SherpaOnnx.swift
sed -n '1289,1392p' swift-api-examples/SherpaOnnx.swift
sed -n '2195,2245p' swift-api-examples/SherpaOnnx.swift
echo "== Swift package manifests / SPM exposure =="
git ls-files | rg 'Package.swift$|Package.resolved$|swift|CMakeLists|SherpaOnnx' | sed -n '1,220p'
echo "== relevant header declarations =="
rg -n "SherpaOnnxOnlineModelConfig|SherpaOnnxOfflineModelConfig|SherpaOnnx.*Config|typedef struct|const char" --glob '*.h' --glob 'C-API*' --glob 'api*' . | sed -n '1,260p'Repository: k2-fsa/sherpa-onnx
Length of output: 48287
🌐 Web query:
Swift NSString UTF8String returned pointer lifetime underlying temporary buffer
💡 Result:
The pointer returned by the NSString utf8String property (and its Objective-C equivalent, UTF8String) points to a memory buffer managed by the NSString object [1][2]. This pointer is not guaranteed to be valid for any duration longer than the lifetime of the NSString object itself [1][3]. In many cases, it may have a significantly shorter lifetime, potentially becoming invalid as soon as the current scope or the current autorelease cycle ends [1][3][4]. Because the returned value is a raw C pointer, it does not participate in Swift's Automatic Reference Counting (ARC) or any other memory management system [5][3]. The system cannot track when you are finished using the pointer, and therefore it cannot prevent the underlying NSString from being deallocated while you are still accessing the buffer [3][2]. If you need to use the string data beyond the immediate scope where the pointer was obtained, you must copy the data (for example, by using strdup or creating a new Swift String or Data object) [1][5][2]. Apple's official documentation explicitly warns: This C string is a pointer to a structure inside the string object, which may have a lifetime shorter than the string object and will certainly not have a longer lifetime. Therefore, you should copy the C string if it needs to be stored outside of the memory context in which you use this property [1][6].
Citations:
- 1: https://developer.apple.com/documentation/foundation/nsstring/utf8string
- 2: https://stackoverflow.com/questions/76140890/memory-leak-from-nsstring%e2%86%92const-char-conversion-in-objective-c
- 3: https://developer.apple.com/forums/thread/28044
- 4: https://stackoverflow.com/questions/3074341/what-is-the-guaranteed-lifecycle-of-nsstring-utf8string
- 5: https://stackoverflow.com/questions/48082094/does-arc-keep-track-of-the-const-char-produced-by-nsstring-utf8string
- 6: https://developer.apple.com/documentation/foundation/nsstring/utf8string?language=objc
Do not expose an unowned C-string pointer from toCPointer.
toCPointer returns the raw utf8String pointer from a temporary bridged NSString; those buffers are not ARCs retained and can be invalidated once the bridged string has no owner. The public config factories then pass these pointers into C structs, so SPM clients can store them until later C calls and read freed memory. Keep the helper internal, only use owned conversion for immediate C calls, or copy/retain the backing string storage in a Swift wrapper.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@swift-api-examples/SherpaOnnx.swift` around lines 16 - 18, Remove the public
`toCPointer` API and eliminate its use for storing string pointers in the public
config factories. Use owned string storage for any pointers retained in C
structs, or restrict pointer conversion to internal immediate C calls where the
backing string remains alive; ensure SPM clients cannot receive pointers backed
by a temporary `NSString`.
| public struct SourceSeparationConfig { | ||
| public struct Spleeter { | ||
| public var vocals: String | ||
| public var accompaniment: String | ||
| } | ||
| struct Uvr { var model: String } | ||
| public struct Uvr { public var model: String } | ||
|
|
||
| var spleeter: Spleeter? | ||
| var uvr: Uvr? | ||
| var numThreads: Int = 1 | ||
| var debug: Bool = false | ||
| var provider: String = "cpu" | ||
| public var spleeter: Spleeter? | ||
| public var uvr: Uvr? | ||
| public var numThreads: Int = 1 | ||
| public var debug: Bool = false | ||
| public var provider: String = "cpu" | ||
|
|
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate and inspect the relevant Swift file and source-separation symbols.
printf 'Files matching SherpaOnnx.swift:\n'
fd -a 'SherpaOnnx.swift' . || true
printf '\nRelevant SourceSeparationConfig area:\n'
file="$(fd 'SherpaOnnx.swift' . | head -n 1)"
if [ -n "${file:-}" ]; then
nl -ba "$file" | sed -n '2168,2242p'
fi
printf '\nSearch for SourceSeparator and SourceSeparationConfig usages/declarations:\n'
rg -n "SourceSeparationConfig|SourceSeparator|Spleeter|Uvr|init\\?\\(config: SourceSeparationConfig\\)|struct Spleeter|struct Uvr" "$file" || true
printf '\nSwift declarations around SourceSeparator init and config struct:\n'
nl -ba "$file" | sed -n '2190,2238p'Repository: k2-fsa/sherpa-onnx
Length of output: 324
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file="$(fd 'SherpaOnnx.swift' . | head -n 1)"
printf 'file=%s\n' "$file"
printf '\nRelevant SourceSeparationConfig/Separator area:\n'
awk 'NR>=2168 && NR<=2242 { printf "%6d\t%s\n", NR, $0 }' "$file"
printf '\nSourceSeparationConfig/SourceSeparator declarations:\n'
rg -n "public struct SourceSeparationConfig|struct SourceSeparationConfig|public struct Spleeter|struct Spleeter|public struct Uvr|struct Uvr|init\\?\\(config: SourceSeparationConfig\\)|struct SourceSeparator|public struct SourceSeparator|class SourceSeparator|public class SourceSeparator" "$file" || trueRepository: k2-fsa/sherpa-onnx
Length of output: 3504
🌐 Web query:
Swift synthesized public initializer nested public struct nested public struct SourceSeparationConfig internal initializer
💡 Result:
In Swift, the compiler does not automatically synthesize a public memberwise initializer for public structs, even if they are nested within another public struct [1][2][3]. By default, the synthesized memberwise initializer for a public struct is internal, which prevents it from being called from outside the defining module [4][2][3]. To make such an initializer available publicly, you must manually implement a public initializer [1][2]. Regarding SourceSeparationConfig, as seen in various Swift API examples (e.g., in projects like sherpa-onnx), it is a common pattern to manually define public initializers for such configuration structs to ensure they can be instantiated across module boundaries [5][6]. The internal initializer error frequently encountered by developers in this context occurs precisely because the implicit, synthesized initializer lacks the necessary public access level [4][7]. Summary of rules: 1. Implicit Initializer Access: For a public struct, the synthesized memberwise initializer is internal by default [2][3]. 2. Nested Structs: Access control for nested types works similarly; even if the nested struct is declared public, its implicit initializer remains internal if not explicitly provided [2][8]. 3. Manual Implementation: To expose the memberwise initializer publicly, you must write it explicitly within the struct definition [1][2]. If you are working with a third-party library where SourceSeparationConfig is not providing a public initializer, you cannot change this behavior externally and must rely on the library author to provide a public init, or wrap the type [4][1][2].
Citations:
- 1: https://stackoverflow.com/questions/26224693/how-can-i-make-the-memberwise-initialiser-public-by-default-for-structs-in-swi
- 2: https://github.com/apple/swift-book/blob/main/TSPL.docc/LanguageGuide/AccessControl.md
- 3: https://github.com/swiftlang/swift/blob/0d3ce199/docs/AccessControl.md
- 4: Control accessibility of memberwise initializers generated by the compiler swiftlang/swift#83722
- 5: https://github.com/k2-fsa/sherpa-onnx/blob/c6691594/swift-api-examples/source-separation-uvr.swift
- 6: https://github.com/k2-fsa/sherpa-onnx/blob/c6691594/swift-api-examples/source-separation-spleeter.swift
- 7: https://forums.swift.org/t/state-of-the-memberwise-initializer/17168
- 8: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/nestedtypes/
Make the exported source-separation types constructible externally.
Spleeter, Uvr, and SourceSeparationConfig are public, but Swift does not synthesize public memberwise initializers for public structs, so external clients cannot build these config objects. Add public initializers for Spleeter, Uvr, and SourceSeparationConfig, and make SourceSeparator.init?(config:) public so the API is usable from its package.
Also applies to: 2229-2233
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@swift-api-examples/SherpaOnnx.swift` around lines 2195 - 2207, Add public
initializers to the nested Spleeter and Uvr structs and to
SourceSeparationConfig, exposing parameters for their configurable properties
with existing defaults preserved. Update SourceSeparator.init?(config:) to be
public so external package clients can construct and use the source-separation
API.
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Updates the iOS SwiftUI example apps to consume SherpaOnnx via Swift Package Manager (SPM) instead of vendored xcframeworks/local Swift glue, and adds CI to ensure the iOS projects build.
Changes:
- Expose Swift helper APIs in
swift-api-examples/SherpaOnnx.swiftaspublicfor package consumption. - Migrate iOS SwiftUI example targets to
import SherpaOnnxand switch Xcode projects to SPM package dependencies. - Add a GitHub Actions workflow to build iOS example projects on macOS runners.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| swift-api-examples/SherpaOnnx.swift | Makes helper functions/wrappers public so they can be imported from the SPM module. |
| ios-swiftui/SherpaOnnxTts/SherpaOnnxTts/ViewModel.swift | Switches to importing the SherpaOnnx module; updates TTS config usage. |
| ios-swiftui/SherpaOnnxTts/SherpaOnnxTts/ContentView.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnxTts/SherpaOnnxTts.xcodeproj/project.pbxproj | Replaces embedded xcframeworks/local Swift file with SPM dependency. |
| ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/SubtitleViewModel.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/SherpaOnnxSubtitleApp.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle/ContentView.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnxSubtitle/SherpaOnnxSubtitle.xcodeproj/project.pbxproj | Replaces embedded xcframeworks/local Swift file with SPM dependency. |
| ios-swiftui/SherpaOnnxLangID/SherpaOnnxLangID/ViewModel.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnxLangID/SherpaOnnxLangID/SherpaOnnxLangIDApp.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnxLangID/SherpaOnnxLangID/ContentView.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnxLangID/SherpaOnnxLangID.xcodeproj/project.pbxproj | Replaces embedded xcframeworks/local Swift file with SPM dependency. |
| ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/SherpaOnnxViewModel.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/SherpaOnnx2PassApp.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/Model.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/Extension.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass/ContentView.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnx2Pass/SherpaOnnx2Pass.xcodeproj/project.pbxproj | Replaces embedded xcframeworks/local Swift file with SPM dependency. |
| ios-swiftui/SherpaOnnx/SherpaOnnx/SherpaOnnxViewModel.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnx/SherpaOnnx/SherpaOnnxApp.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnx/SherpaOnnx/Model.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnx/SherpaOnnx/Extension.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnx/SherpaOnnx/ContentView.swift | Switches to importing the SherpaOnnx module. |
| ios-swiftui/SherpaOnnx/SherpaOnnx.xcodeproj/project.pbxproj | Replaces embedded xcframeworks/local Swift file with SPM dependency. |
| ios-swiftui/.gitignore | Ignores SwiftPM-generated project workspace metadata directory. |
| .github/workflows/ios.yaml | Adds CI workflow to build the iOS SwiftUI example projects. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public func toCPointer(_ s: String) -> UnsafePointer<Int8>! { | ||
| let cs = (s as NSString).utf8String | ||
| return UnsafePointer<Int8>(cs) | ||
| } |
| public struct SourceSeparationConfig { | ||
| public struct Spleeter { | ||
| public var vocals: String | ||
| public var accompaniment: String | ||
| } | ||
| struct Uvr { var model: String } | ||
| public struct Uvr { public var model: String } | ||
|
|
||
| var spleeter: Spleeter? | ||
| var uvr: Uvr? | ||
| var numThreads: Int = 1 | ||
| var debug: Bool = false | ||
| var provider: String = "cpu" | ||
| public var spleeter: Spleeter? | ||
| public var uvr: Uvr? | ||
| public var numThreads: Int = 1 | ||
| public var debug: Bool = false | ||
| public var provider: String = "cpu" |
| public class SourceSeparator { | ||
| private var engine: OpaquePointer? | ||
|
|
||
| init?(config: SourceSeparationConfig) { |
| /// print("text: \(result.text)") | ||
| /// | ||
| class SherpaOnnxOnlineRecongitionResult { | ||
| public class SherpaOnnxOnlineRecongitionResult { |
| buildConfigurationList = DEA6571F2ABF19740066A81D /* Build configuration list for PBXNativeTarget "SherpaOnnxSubtitle" */; | ||
| buildPhases = ( | ||
| DEA6570D2ABF19730066A81D /* Sources */, | ||
| DEA6570E2ABF19730066A81D /* Frameworks */, | ||
| DEA6570F2ABF19730066A81D /* Resources */, | ||
| ); |
| buildConfigurationList = DEBB2D962BBAAA3600864EF5 /* Build configuration list for PBXNativeTarget "SherpaOnnxLangID" */; | ||
| buildPhases = ( | ||
| DEBB2D6E2BBAAA3500864EF5 /* Sources */, | ||
| DEBB2D6F2BBAAA3500864EF5 /* Frameworks */, | ||
| DEBB2D702BBAAA3500864EF5 /* Resources */, | ||
| DEBB2DAE2BBAAC6200864EF5 /* Embed Frameworks */, | ||
| ); |
| buildConfigurationList = C9A258872AAEFFF200E555CA /* Build configuration list for PBXNativeTarget "SherpaOnnx2Pass" */; | ||
| buildPhases = ( | ||
| C9A258752AAEFFF100E555CA /* Sources */, | ||
| C9A258762AAEFFF100E555CA /* Frameworks */, | ||
| C9A258772AAEFFF100E555CA /* Resources */, | ||
| ); |
| buildConfigurationList = C924F34E29DDAC0D00A440A5 /* Build configuration list for PBXNativeTarget "SherpaOnnx" */; | ||
| buildPhases = ( | ||
| C924F32629DDAC0B00A440A5 /* Sources */, | ||
| C924F32729DDAC0B00A440A5 /* Frameworks */, | ||
| C924F32829DDAC0B00A440A5 /* Resources */, | ||
| ); |
| cd ios-swiftui/SherpaOnnx | ||
| xcodebuild -project SherpaOnnx.xcodeproj \ | ||
| -scheme SherpaOnnx \ | ||
| -destination 'generic/platform=iOS Simulator' \ | ||
| -skipPackagePluginValidation \ | ||
| build | tail -20 |
| C9SP000000000003 /* XCRemoteSwiftPackageReference "sherpa-onnx" */ = { | ||
| isa = XCRemoteSwiftPackageReference; | ||
| repositoryURL = "https://github.com/k2-fsa/sherpa-onnx"; | ||
| requirement = { | ||
| kind = branch; | ||
| branch = master; | ||
| }; | ||
| }; |
Summary by CodeRabbit
API Updates
Build & Quality
Chores