Skip to content
Open
Show file tree
Hide file tree
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 Jul 28, 2025
d3d481a
fixed filler audio
Suryansh1191 Jul 29, 2025
349ff15
made fillter audio and TTS working
Suryansh1191 Jul 29, 2025
818ab06
configuration changes for TTS
Suryansh1191 Jul 30, 2025
4f4f9d8
updated first TTS chuck to take atleast 80 charaters
Suryansh1191 Jul 30, 2025
1a88496
fix tts
void-memories Jul 30, 2025
be7f9b4
reduce playback gap
void-memories Jul 30, 2025
68d85f9
fix filler skip
void-memories Jul 30, 2025
1745df0
fix finish audio playing in between
void-memories Jul 30, 2025
d702323
fix atomic increment
void-memories Jul 30, 2025
c040ba9
optimise filler function for lists
void-memories Jul 30, 2025
798c543
fix premature loader
void-memories Jul 30, 2025
fbb0d87
improve debug statements
void-memories Jul 30, 2025
f35f269
remove the wav player
void-memories Jul 30, 2025
1c68045
code cleanup
void-memories Jul 30, 2025
970ec47
vars name change
void-memories Jul 30, 2025
d1a4c25
fix playback mode change
void-memories Jul 31, 2025
d5ab9fa
updated UX for ASR
Suryansh1191 Jul 31, 2025
dc3af84
fixed UI and downloading way
Suryansh1191 Jul 31, 2025
d42a185
fixed chat issues
Suryansh1191 Aug 1, 2025
bb5f4c8
DeliteAI and ET changes
Suryansh1191 Aug 11, 2025
95401fe
updated deliteAI pod version
Suryansh1191 Aug 11, 2025
7182633
firebase fix
Suryansh1191 Aug 11, 2025
4d3fd78
setup secrets
Suryansh1191 Aug 11, 2025
22556a7
Merge pull request #1 from psyv2/ios_secrets
Suryansh1191 Aug 12, 2025
7fd2edb
uncommented FirebaseApp.configure()
Suryansh1191 Aug 12, 2025
3b03026
removed GoogleService-Info.plist from iOS
Suryansh1191 Aug 12, 2025
3f6991d
re-added GoogleService-Info.plist
Suryansh1191 Aug 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ build/
!default.perspectivev3
xcuserdata/
*.xcscmblueprint
*.xcconfig
ios/secrets.xcconfig


# CocoaPods
Expand Down
12 changes: 6 additions & 6 deletions ios/GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>xxxx</string>
<string>AIzaSyBBkqI6xhepfIJSDP-gshFJgTL1JkN2HM8</string>
<key>GCM_SENDER_ID</key>
<string>699282062446</string>
<key>PLIST_VERSION</key>
Expand All @@ -15,15 +15,15 @@
<key>STORAGE_BUCKET</key>
<string>ne-chatapp.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<false/>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<false/>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<true/>
<key>IS_GCM_ENABLED</key>
<true></true>
<true/>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<true/>
<key>GOOGLE_APP_ID</key>
<string>1:699282062446:ios:9b73dca41ddf3a71bb3a7f</string>
</dict>
Expand Down
8 changes: 8 additions & 0 deletions ios/NimbleEdgeAI Assistant.entitlements
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>
126 changes: 98 additions & 28 deletions ios/NimbleEdgeAI Assistant.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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>
28 changes: 21 additions & 7 deletions ios/NimbleEdgeAI/Constants/NimbleNetSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,26 @@
* SPDX-License-Identifier: Apache-2.0
*/

import Foundation

class NimbleNetSettings {
public static var clientID = ""
public static var clientSecret = ""
public static var host = ""
public static var deviceId = ""
public static var debug = true
public static var compatibilityTag = ""
public static var lowerTierCompatibilityTag = ""
public static var clientID: String {
return Bundle.main.object(forInfoDictionaryKey: "NIMBLE_CLIENT_ID") as? String ?? ""
}
public static var clientSecret: String {
return Bundle.main.object(forInfoDictionaryKey: "NIMBLE_CLIENT_SECRET") as? String ?? ""
}
public static var host: String {
return ("https://" + (Bundle.main.object(forInfoDictionaryKey: "NIMBLE_HOST") as? String ?? ""))
}
public static var deviceId: String {
return Bundle.main.object(forInfoDictionaryKey: "NIMBLE_DEVICE_ID") as? String ?? ""
}
public static var compatibilityTag: String {
return Bundle.main.object(forInfoDictionaryKey: "NIMBLE_COMPATIBILITY_TAG") as? String ?? ""
}
public static var lowerTierCompatibilityTag: String {
return Bundle.main.object(forInfoDictionaryKey: "NIMBLE_LOWER_TIER_COMPATIBILITY_TAG") as? String ?? ""
}
public static var debug: Bool = false
}
87 changes: 87 additions & 0 deletions ios/NimbleEdgeAI/EspeakNGService.swift
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
}
}

20 changes: 19 additions & 1 deletion ios/NimbleEdgeAI/Info.plist
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>
19 changes: 11 additions & 8 deletions ios/NimbleEdgeAI/NimbleEdgeAIApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
*/

import SwiftUI
import NimbleNetiOS
import DeliteAI
import Firebase
import StoreKit

@main
struct NimbleEdgeAIApp: App {
@State private var isDownloadComplete = false
@State private var isLLMDownloaded = true // skipping dowload progress manager
@State private var isLLMDownloaded = UserDefaults.standard.bool(forKey: "isLLMDownloaded")
@State private var showDownloadPage = false
@State private var showInitialisationFailureAlert = false
@State private var showAppNotSupportedAlert = false
Expand Down Expand Up @@ -98,18 +98,19 @@ struct NimbleEdgeAIApp: App {
}

func initialise() {
setupEspeakCallbacks()
if DeviceIdentification.getDeviceTier() == .three {
showAppNotSupportedAlert = true
} else {
let initialiseStatus = initializeNimbeNet()
showInitialisationFailureAlert = !initialiseStatus
waitForIsReady()
}
}
}

@discardableResult
func initializeNimbeNet() -> Bool {
setupEspeakCallbacks()

let compatibilityTag = DeviceIdentification.getDeviceTier() == .two ? NimbleNetSettings.lowerTierCompatibilityTag : NimbleNetSettings.compatibilityTag

Expand All @@ -118,15 +119,17 @@ func initializeNimbeNet() -> Bool {
host: NimbleNetSettings.host,
deviceId: NimbleNetSettings.deviceId,
debug: NimbleNetSettings.debug,
compatibilityTag: compatibilityTag)
compatibilityTag: compatibilityTag,
online: true
)

return NimbleNetApi.initialize(config: nimbleNetConfig).status
}

func waitForIsReady() {
while !NimbleNetApi.isReady().status {
RunLoop.main.run(until: Date().addingTimeInterval(0.1))
}
func setupEspeakCallbacks() {
let espeakNGContext = EspeakNGService.shared
EspeakNGCallbacks.textToPhonemes = espeakNGContext.set_espeak_text_to_phonemes_callback
espeakNGContext.set_espeak_initialize_callback()
}

class GlobalState {
Expand Down
Loading