-
Notifications
You must be signed in to change notification settings - Fork 12
[iOS] AST and TTS changes using DeliteAI SDK #27
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
Open
Suryansh1191
wants to merge
28
commits into
NimbleEdge:main
Choose a base branch
from
psyv2:espeak_et_suryansh_1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
60280b6
addind espeak SPM dependency
psyv2 d3d481a
fixed filler audio
Suryansh1191 349ff15
made fillter audio and TTS working
Suryansh1191 818ab06
configuration changes for TTS
Suryansh1191 4f4f9d8
updated first TTS chuck to take atleast 80 charaters
Suryansh1191 1a88496
fix tts
void-memories be7f9b4
reduce playback gap
void-memories 68d85f9
fix filler skip
void-memories 1745df0
fix finish audio playing in between
void-memories d702323
fix atomic increment
void-memories c040ba9
optimise filler function for lists
void-memories 798c543
fix premature loader
void-memories fbb0d87
improve debug statements
void-memories f35f269
remove the wav player
void-memories 1c68045
code cleanup
void-memories 970ec47
vars name change
void-memories d1a4c25
fix playback mode change
void-memories d5ab9fa
updated UX for ASR
Suryansh1191 dc3af84
fixed UI and downloading way
Suryansh1191 d42a185
fixed chat issues
Suryansh1191 bb5f4c8
DeliteAI and ET changes
Suryansh1191 95401fe
updated deliteAI pod version
Suryansh1191 7182633
firebase fix
Suryansh1191 4d3fd78
setup secrets
Suryansh1191 22556a7
Merge pull request #1 from psyv2/ios_secrets
Suryansh1191 7fd2edb
uncommented FirebaseApp.configure()
Suryansh1191 3b03026
removed GoogleService-Info.plist from iOS
Suryansh1191 3f6991d
re-added GoogleService-Info.plist
Suryansh1191 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>com.apple.developer.kernel.increased-memory-limit</key> | ||
| <true/> | ||
| </dict> | ||
| </plist> |
Large diffs are not rendered by default.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
ios/NimbleEdgeAI Assistant.xcodeproj/xcshareddata/xcschemes/NimbleEdgeAI Assistant.xcscheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <Scheme | ||
| LastUpgradeVersion = "1640" | ||
| version = "1.7"> | ||
| <BuildAction | ||
| parallelizeBuildables = "YES" | ||
| buildImplicitDependencies = "YES" | ||
| buildArchitectures = "Automatic"> | ||
| <BuildActionEntries> | ||
| <BuildActionEntry | ||
| buildForTesting = "YES" | ||
| buildForRunning = "YES" | ||
| buildForProfiling = "YES" | ||
| buildForArchiving = "YES" | ||
| buildForAnalyzing = "YES"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "F1713F2F2D1024220037358A" | ||
| BuildableName = "NimbleEdge AI.app" | ||
| BlueprintName = "NimbleEdgeAI Assistant" | ||
| ReferencedContainer = "container:NimbleEdgeAI Assistant.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildActionEntry> | ||
| </BuildActionEntries> | ||
| </BuildAction> | ||
| <TestAction | ||
| buildConfiguration = "Debug" | ||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| shouldUseLaunchSchemeArgsEnv = "YES" | ||
| shouldAutocreateTestPlan = "YES"> | ||
| </TestAction> | ||
| <LaunchAction | ||
| buildConfiguration = "Release" | ||
| selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| launchStyle = "0" | ||
| useCustomWorkingDirectory = "NO" | ||
| ignoresPersistentStateOnLaunch = "NO" | ||
| debugDocumentVersioning = "YES" | ||
| debugServiceExtension = "internal" | ||
| allowLocationSimulation = "YES"> | ||
| <BuildableProductRunnable | ||
| runnableDebuggingMode = "0"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "F1713F2F2D1024220037358A" | ||
| BuildableName = "NimbleEdge AI.app" | ||
| BlueprintName = "NimbleEdgeAI Assistant" | ||
| ReferencedContainer = "container:NimbleEdgeAI Assistant.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildableProductRunnable> | ||
| </LaunchAction> | ||
| <ProfileAction | ||
| buildConfiguration = "Release" | ||
| shouldUseLaunchSchemeArgsEnv = "YES" | ||
| savedToolIdentifier = "" | ||
| useCustomWorkingDirectory = "NO" | ||
| debugDocumentVersioning = "YES"> | ||
| <BuildableProductRunnable | ||
| runnableDebuggingMode = "0"> | ||
| <BuildableReference | ||
| BuildableIdentifier = "primary" | ||
| BlueprintIdentifier = "F1713F2F2D1024220037358A" | ||
| BuildableName = "NimbleEdge AI.app" | ||
| BlueprintName = "NimbleEdgeAI Assistant" | ||
| ReferencedContainer = "container:NimbleEdgeAI Assistant.xcodeproj"> | ||
| </BuildableReference> | ||
| </BuildableProductRunnable> | ||
| </ProfileAction> | ||
| <AnalyzeAction | ||
| buildConfiguration = "Debug"> | ||
| </AnalyzeAction> | ||
| <ArchiveAction | ||
| buildConfiguration = "Release" | ||
| revealArchiveInOrganizer = "YES"> | ||
| </ArchiveAction> | ||
| </Scheme> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| import libespeak_ng | ||
| class EspeakNGService { | ||
| var directory: String = "" | ||
| var internalStorage = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.path() | ||
| static let shared = EspeakNGService() | ||
| private init(){ | ||
| copyEspeakDataToInternalStorage() | ||
| } | ||
|
|
||
| func copyEspeakDataToInternalStorage(){ | ||
| if let directoryURL = copyDirectoryToDocuments(directoryName: "espeak-ng-data") { | ||
| let directoryPath = directoryURL.path | ||
| directory = directoryPath | ||
| UserDefaults.standard.set(directoryURL.path, forKey: "CopiedDirectoryPath") | ||
| } | ||
| } | ||
|
|
||
| func set_espeak_initialize_callback() -> Int{ | ||
|
|
||
| let internalStorageCString = strdup(internalStorage) | ||
| let res = libespeak_ng.espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, 300, internalStorageCString, 0) | ||
| libespeak_ng.espeak_SetVoiceByName("en"); | ||
| if internalStorageCString != nil { | ||
| free(internalStorageCString) | ||
| } | ||
| return Int(res) | ||
| } | ||
|
|
||
| func set_espeak_text_to_phonemes_callback(text: String) -> String{ | ||
| let utf8CString = text.utf8CString // Includes null terminator | ||
| var phonemeResult = "" | ||
| // Pass pointer-to-pointer to the function | ||
| utf8CString.withUnsafeBufferPointer { bufferPointer in | ||
| guard let baseAddress = bufferPointer.baseAddress else { | ||
| print("Failed to get base address") | ||
| return | ||
| } | ||
|
|
||
| // Create a pointer to the base address (const void**) | ||
| var rawPointer: UnsafeRawPointer? = UnsafeRawPointer(baseAddress) | ||
|
|
||
| // Allocate a pointer to that pointer | ||
| withUnsafeMutablePointer(to: &rawPointer) { textPtr in | ||
| let result = libespeak_ng.espeak_TextToPhonemes( | ||
| textPtr as UnsafeMutablePointer<UnsafeRawPointer?>, | ||
| espeakCHARS_UTF8, | ||
| 24322 | ||
| ) | ||
|
|
||
| if let result = result { | ||
| let phonemes = String(cString: result) | ||
| print("Phoneme output:", phonemes) | ||
| phonemeResult = phonemes | ||
| } else { | ||
| print("Phoneme conversion failed") | ||
| } | ||
| } | ||
| } | ||
| return phonemeResult | ||
| } | ||
| } | ||
|
|
||
| func copyDirectoryToDocuments(directoryName: String) -> URL? { | ||
|
|
||
| guard let sourcePath = Bundle.main.path(forResource: directoryName, ofType: nil) else { | ||
| print("Directory \(directoryName) not found in bundle") | ||
| return nil | ||
| } | ||
|
|
||
| let sourceURL = URL(fileURLWithPath: sourcePath) | ||
|
|
||
| let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! | ||
| let destinationURL = documentsDirectory.appendingPathComponent(directoryName) | ||
|
|
||
| do { | ||
| if FileManager.default.fileExists(atPath: destinationURL.path) { | ||
| return destinationURL | ||
| } | ||
|
|
||
| try FileManager.default.copyItem(at: sourceURL, to: destinationURL) | ||
| return destinationURL | ||
| } catch { | ||
| print("Error copying directory: \(error)") | ||
| return nil | ||
| } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,23 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict/> | ||
| <dict> | ||
| <key>NIMBLE_CLIENT_ID</key> | ||
| <string>$(NIMBLE_CLIENT_ID)</string> | ||
|
|
||
| <key>NIMBLE_CLIENT_SECRET</key> | ||
| <string>$(NIMBLE_CLIENT_SECRET)</string> | ||
|
|
||
| <key>NIMBLE_HOST</key> | ||
| <string>$(NIMBLE_HOST)</string> | ||
|
|
||
| <key>NIMBLE_DEVICE_ID</key> | ||
| <string>$(NIMBLE_DEVICE_ID)</string> | ||
|
|
||
| <key>NIMBLE_COMPATIBILITY_TAG</key> | ||
| <string>$(NIMBLE_COMPATIBILITY_TAG)</string> | ||
|
|
||
| <key>NIMBLE_LOWER_TIER_COMPATIBILITY_TAG</key> | ||
| <string>$(NIMBLE_LOWER_TIER_COMPATIBILITY_TAG)</string> | ||
| </dict> | ||
| </plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.