Skip to content

Commit bb50a47

Browse files
authored
Merge branch 'dev' into fix/fixed-images
2 parents c3fd89b + e3ba858 commit bb50a47

56 files changed

Lines changed: 18362 additions & 14614 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ extras/speaker-recognition/Caddyfile
8383
# Cache
8484
extras/speaker-recognition/cache/*
8585
extras/speaker-recognition/outputs/*
86+
**/model_cache_strix_test/*
8687

8788
# my backup
8889
backends/advanced/src/_webui_original/*

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Usecases are numerous - OMI Mentor is one of them. Friend/Omi/pendants are a sma
170170

171171
Regardless - this repo will try to do the minimal of this - multiple OMI-like audio devices feeding audio data - and from it:
172172
- Memories
173-
- Action items
173+
- Action items
174174
- Home automation
175175

176176
## Golden Goals (Not Yet Achieved)
@@ -179,4 +179,3 @@ Regardless - this repo will try to do the minimal of this - multiple OMI-like au
179179
- **Home automation integration** (planned)
180180
- **Multi-device coordination** (planned)
181181
- **Visual context capture** (smart glasses integration planned)
182-

app/src/components/StatusIndicator.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ const StatusIndicator: React.FC<StatusIndicatorProps> = ({
1515
inactiveColor = '#FF3B30', // Red
1616
}) => {
1717
return (
18-
<View
18+
<View
1919
style={[
2020
styles.dot,
21-
{
22-
width: size,
23-
height: size,
21+
{
22+
width: size,
23+
height: size,
2424
borderRadius: size / 2,
2525
backgroundColor: isActive ? activeColor : inactiveColor,
2626
}
@@ -40,4 +40,4 @@ const styles = StyleSheet.create({
4040
},
4141
});
4242

43-
export default StatusIndicator;
43+
export default StatusIndicator;

app/src/hooks/.gitkeep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-

app/src/hooks/useAudioListener.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,38 @@ export const useAudioListener = (
2222
const [isRetrying, setIsRetrying] = useState<boolean>(false);
2323
const [retryAttempts, setRetryAttempts] = useState<number>(0);
2424
const { addEvent } = useConnectionLog();
25-
25+
2626
const audioSubscriptionRef = useRef<Subscription | null>(null);
2727
const uiUpdateIntervalRef = useRef<NodeJS.Timeout | null>(null);
2828
const localPacketCounterRef = useRef<number>(0);
2929
const retryTimeoutRef = useRef<NodeJS.Timeout | null>(null);
3030
const shouldRetryRef = useRef<boolean>(false);
3131
const currentOnAudioDataRef = useRef<((bytes: Uint8Array) => void) | null>(null);
32-
32+
3333
// Retry configuration
3434
const MAX_RETRY_ATTEMPTS = 10;
3535
const INITIAL_RETRY_DELAY = 1000; // 1 second
3636
const MAX_RETRY_DELAY = 60000; // 60 seconds
3737

3838
const stopAudioListener = useCallback(async () => {
3939
console.log('Attempting to stop audio listener...');
40-
40+
4141
// Stop retry mechanism
4242
shouldRetryRef.current = false;
4343
setIsRetrying(false);
4444
setRetryAttempts(0);
4545
currentOnAudioDataRef.current = null;
46-
46+
4747
if (retryTimeoutRef.current) {
4848
clearTimeout(retryTimeoutRef.current);
4949
retryTimeoutRef.current = null;
5050
}
51-
51+
5252
if (uiUpdateIntervalRef.current) {
5353
clearInterval(uiUpdateIntervalRef.current);
5454
uiUpdateIntervalRef.current = null;
5555
}
56-
56+
5757
if (audioSubscriptionRef.current) {
5858
try {
5959
await omiConnection.stopAudioBytesListener(audioSubscriptionRef.current);
@@ -147,7 +147,7 @@ export const useAudioListener = (
147147
setIsRetrying(true);
148148

149149
const success = await attemptStartAudioListener(currentOnAudioDataRef.current);
150-
150+
151151
if (success) {
152152
console.log('[AudioListener] Retry successful');
153153
return;
@@ -157,7 +157,7 @@ export const useAudioListener = (
157157
if (shouldRetryRef.current) {
158158
const delay = getRetryDelay(currentAttempt);
159159
console.log(`[AudioListener] Scheduling retry in ${Math.round(delay)}ms`);
160-
160+
161161
retryTimeoutRef.current = setTimeout(() => {
162162
if (shouldRetryRef.current) {
163163
retryStartAudioListener();
@@ -171,7 +171,7 @@ export const useAudioListener = (
171171
Alert.alert('Not Connected', 'Please connect to a device first to start audio listener.');
172172
return;
173173
}
174-
174+
175175
if (isListeningAudio) {
176176
console.log('[AudioListener] Audio listener is already active. Stopping first.');
177177
await stopAudioListener();
@@ -180,7 +180,7 @@ export const useAudioListener = (
180180
// Store the callback for retry attempts
181181
currentOnAudioDataRef.current = onAudioData;
182182
shouldRetryRef.current = true;
183-
183+
184184
setAudioPacketsReceived(0); // Reset counter on start
185185
localPacketCounterRef.current = 0;
186186
setRetryAttempts(0);
@@ -197,7 +197,7 @@ export const useAudioListener = (
197197

198198
// Try to start audio listener
199199
const success = await attemptStartAudioListener(onAudioData);
200-
200+
201201
if (!success && shouldRetryRef.current) {
202202
console.log('[AudioListener] Initial attempt failed, starting retry mechanism');
203203
setIsRetrying(true);
@@ -227,4 +227,4 @@ export const useAudioListener = (
227227
isRetrying,
228228
retryAttempts,
229229
};
230-
};
230+
};

app/src/hooks/useBluetoothManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const useBluetoothManager = () => {
4949
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
5050
];
5151
}
52-
52+
5353
console.log('[BTManager] Android permissions to request:', permissionsToRequest);
5454
const statuses = await PermissionsAndroid.requestMultiple(permissionsToRequest);
5555
console.log('[BTManager] Android permission statuses:', statuses);
@@ -100,12 +100,12 @@ export const useBluetoothManager = () => {
100100
checkAndRequestPermissions();
101101
}
102102
}, [bluetoothState, checkAndRequestPermissions]); // Rerun if BT state changes or on initial mount
103-
103+
104104
return {
105105
bleManager,
106106
bluetoothState,
107107
permissionGranted,
108108
requestBluetoothPermission: checkAndRequestPermissions,
109109
isPermissionsLoading,
110110
};
111-
};
111+
};

app/src/hooks/useDeviceConnection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,4 @@ export const useDeviceConnection = (
189189
getRawBatteryLevel,
190190
connectedDeviceId
191191
};
192-
};
192+
};

app/src/hooks/useDeviceScanning.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const useDeviceScanning = (
4949
const startScan = useCallback(async () => {
5050
console.log('[Scanner] startScan called');
5151
setError(null);
52-
setDevices([]);
52+
setDevices([]);
5353

5454
if (scanning) {
5555
console.log('[Scanner] Scan already in progress. Stopping previous scan first.');
@@ -80,7 +80,7 @@ export const useDeviceScanning = (
8080
setError('Bluetooth is not enabled. Please turn on Bluetooth.');
8181
return;
8282
}
83-
83+
8484
const currentState = await bleManager.state();
8585
if (currentState !== BluetoothState.PoweredOn) {
8686
console.warn(`[Scanner] Bluetooth state is ${currentState}, not PoweredOn. Cannot scan.`);
@@ -143,4 +143,4 @@ export const useDeviceScanning = (
143143
}, [handleStopScan]);
144144

145145
return { devices, scanning, startScan, stopScan: handleStopScan, error };
146-
};
146+
};

app/src/hooks/usePhoneAudioRecorder.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const usePhoneAudioRecorder = (): UsePhoneAudioRecorder => {
3434
const [isInitializing, setIsInitializing] = useState<boolean>(false);
3535
const [error, setError] = useState<string | null>(null);
3636
const [audioLevel, setAudioLevel] = useState<number>(0);
37-
37+
3838
const onAudioDataRef = useRef<((pcmBuffer: Uint8Array) => void) | null>(null);
3939
const mountedRef = useRef<boolean>(true);
4040

@@ -53,13 +53,13 @@ export const usePhoneAudioRecorder = (): UsePhoneAudioRecorder => {
5353
try {
5454
const audioData = event.data;
5555
console.log('[PhoneAudioRecorder] processAudioDataEvent called, data type:', typeof audioData);
56-
56+
5757
if (typeof audioData === 'string') {
5858
// Base64 encoded data (native platforms) - decode using react-native-base64
5959
console.log('[PhoneAudioRecorder] Decoding Base64 string, length:', audioData.length);
6060
const binaryString = base64.decode(audioData);
6161
console.log('[PhoneAudioRecorder] Decoded to binary string, length:', binaryString.length);
62-
62+
6363
const bytes = new Uint8Array(binaryString.length);
6464
for (let i = 0; i < binaryString.length; i++) {
6565
bytes[i] = binaryString.charCodeAt(i);
@@ -148,10 +148,10 @@ export const usePhoneAudioRecorder = (): UsePhoneAudioRecorder => {
148148
intervalAnalysis: 500, // Analysis every 500ms
149149
onAudioStream: async (event: AudioDataEvent) => {
150150
// EXACT payload handling from guide
151-
const payload = typeof event.data === "string"
152-
? event.data
151+
const payload = typeof event.data === "string"
152+
? event.data
153153
: Buffer.from(event.data as unknown as ArrayBuffer).toString("base64");
154-
154+
155155
// Convert to our expected format
156156
if (onAudioDataRef.current && mountedRef.current) {
157157
const pcmBuffer = processAudioDataEvent(event);
@@ -163,7 +163,7 @@ export const usePhoneAudioRecorder = (): UsePhoneAudioRecorder => {
163163
};
164164

165165
const result = await startRecorderInternal(config);
166-
166+
167167
if (!result) {
168168
throw new Error('Failed to start recording');
169169
}
@@ -185,7 +185,7 @@ export const usePhoneAudioRecorder = (): UsePhoneAudioRecorder => {
185185
// Stop recording
186186
const stopRecording = useCallback(async (): Promise<void> => {
187187
console.log('[PhoneAudioRecorder] Stopping recording...');
188-
188+
189189
// Early return if not recording
190190
if (!isRecording) {
191191
console.log('[PhoneAudioRecorder] Not recording, nothing to stop');
@@ -194,7 +194,7 @@ export const usePhoneAudioRecorder = (): UsePhoneAudioRecorder => {
194194
setStateSafe(setIsInitializing, false);
195195
return;
196196
}
197-
197+
198198
onAudioDataRef.current = null;
199199
setStateSafe(setAudioLevel, 0);
200200

@@ -231,13 +231,13 @@ export const usePhoneAudioRecorder = (): UsePhoneAudioRecorder => {
231231
console.log('[PhoneAudioRecorder] Component unmounting, setting mountedRef to false');
232232
};
233233
}, []); // Empty dependency array - only runs on mount/unmount
234-
234+
235235
// Separate effect for stopping recording when needed
236236
useEffect(() => {
237237
return () => {
238238
// Stop recording if active when dependencies change
239239
if (isRecording) {
240-
stopRecorderInternal().catch(err =>
240+
stopRecorderInternal().catch(err =>
241241
console.error('[PhoneAudioRecorder] Cleanup stop error:', err)
242242
);
243243
}
@@ -252,4 +252,4 @@ export const usePhoneAudioRecorder = (): UsePhoneAudioRecorder => {
252252
startRecording,
253253
stopRecording,
254254
};
255-
};
255+
};

app/src/utils/storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,4 @@ export const clearAuthData = async (): Promise<void> => {
207207
} catch (error) {
208208
console.error('[Storage] Error clearing auth data:', error);
209209
}
210-
};
210+
};

0 commit comments

Comments
 (0)