Skip to content

Commit 86e3266

Browse files
authored
Merge pull request #3595 from Mentra-Community/aisraelov/camera-riser-sound
Play prep clicks and sensor-timed snaps for photos
2 parents 418ba69 + 4b3901e commit 86e3266

23 files changed

Lines changed: 2001 additions & 350 deletions
34.9 KB
Binary file not shown.
96.7 KB
Binary file not shown.
-80.5 KB
Binary file not shown.
-80.5 KB
Binary file not shown.

asg_client/app/src/main/java/com/mentra/asg_client/AsgConstants.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public class AsgConstants {
5252

5353
public static final long CAMERA_WARM_UP_MAX_DURATION_MS = 60_000L;
5454

55+
/** Cadence for the short hold-still click while a cold photo spins up the camera. */
56+
public static final long CAMERA_PREP_CLICK_INTERVAL_MS = 900L;
57+
58+
/** Target lead before the estimated end of sensor exposure for starting the camera snap. */
59+
public static final long CAMERA_SNAP_TARGET_LEAD_MS = 100L;
60+
5561
/** Safety lease for a miniapp-owned transient FOV override. */
5662
public static final long CAMERA_FOV_OVERRIDE_DEFAULT_TTL_MS = 300_000L;
5763

Lines changed: 25 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package com.mentra.asg_client.audio;
22

33
/**
4-
* Constants for audio asset file names in the application's assets directory.
5-
* Most audio files are in WAV format for optimal compatibility with I2S audio routing.
6-
* Some files (like battery announcements and storage alerts) use MP3 format.
4+
* Constants for audio asset file names in the application's assets directory. Most audio files are
5+
* in WAV format for optimal compatibility with I2S audio routing. Some files (like battery
6+
* announcements and storage alerts) use MP3 format.
7+
*
8+
* <p>Usage:
79
*
8-
* Usage:
910
* <pre>
1011
* if (hardwareManager.supportsAudioPlayback()) {
11-
* hardwareManager.playAudioAsset(AudioAssets.TAKE_PHOTO_HOT);
12+
* hardwareManager.playAudioAsset(AudioAssets.CAMERA_SNAP);
1213
* }
1314
* </pre>
1415
*/
@@ -19,91 +20,53 @@ private AudioAssets() {
1920
throw new AssertionError("AudioAssets is a utility class and should not be instantiated");
2021
}
2122

22-
/**
23-
* Low battery notification sound
24-
*/
23+
/** Low battery notification sound */
2524
public static final String BATTERY_LOW = "battery_low.wav";
2625

27-
/**
28-
* Storage full notification sound
29-
*/
26+
/** Storage full notification sound */
3027
public static final String STORAGE_FULL = "storage_full.mp3";
3128

32-
/**
33-
* Shutter sound for a "cold" photo capture — the camera was not already running, so it must
34-
* spin up (1–2s on Mentra Live due to slow ISP startup) before the shot lands. This is a
35-
* longer clip whose duration spans the warmup so the user keeps their head still until the
36-
* photo is actually taken.
37-
*/
38-
public static final String TAKE_PHOTO_COLD = "take_photo_cold.wav";
29+
/** Short hold-still cue repeated while a cold capture spins up the camera and ISP. */
30+
public static final String CAMERA_PREP_CLICK = "camera_prep_click.wav";
3931

40-
/**
41-
* Shutter sound for a "hot" photo capture — the camera was already running (kept alive after a
42-
* recent shot), so the capture is near-instant. This is a short clip for snappy, responsive
43-
* feedback on rapid-fire shots.
44-
*/
45-
public static final String TAKE_PHOTO_HOT = "take_photo_hot.wav";
32+
/** Camera snap anchored to sensor exposure timing or the completed JPEG frame boundary. */
33+
public static final String CAMERA_SNAP = "camera_snap.wav";
4634

47-
/**
48-
* UI click or button press sound
49-
*/
35+
/** UI click or button press sound */
5036
public static final String CLICK_SOUND = "click_sound.wav";
5137

52-
/**
53-
* Device/glasses connected notification
54-
*/
38+
/** Device/glasses connected notification */
5539
public static final String CONNECTED = "connected.wav";
5640

57-
/**
58-
* Device/glasses disconnected notification
59-
*/
41+
/** Device/glasses disconnected notification */
6042
public static final String DISCONNECTED = "disconnected.wav";
6143

62-
/**
63-
* Power off sound
64-
*/
44+
/** Power off sound */
6545
public static final String POWER_OFF = "power_off.wav";
6646

67-
/**
68-
* Power on sound
69-
*/
47+
/** Power on sound */
7048
public static final String POWER_ON = "power_on.wav";
7149

72-
/**
73-
* Audio recording started notification
74-
*/
50+
/** Audio recording started notification */
7551
public static final String RECORDING_START = "recording_start.wav";
7652

77-
/**
78-
* Audio recording stopped notification
79-
*/
53+
/** Audio recording stopped notification */
8054
public static final String RECORDING_STOP = "recording_stop.wav";
8155

82-
/**
83-
* Volume adjustment sound
84-
*/
56+
/** Volume adjustment sound */
8557
public static final String VOLUME_CHANGE = "volume_change.wav";
8658

87-
/**
88-
* Video recording started notification
89-
* Same as audio recording start for consistency
90-
*/
59+
/** Video recording started notification Same as audio recording start for consistency */
9160
public static final String VIDEO_RECORDING_START = RECORDING_START;
9261

93-
/**
94-
* Video recording stopped notification
95-
* Same as audio recording stop for consistency
96-
*/
62+
/** Video recording stopped notification Same as audio recording stop for consistency */
9763
public static final String VIDEO_RECORDING_STOP = RECORDING_STOP;
9864

99-
/**
100-
* Battery level announcement audio folder prefix
101-
*/
65+
/** Battery level announcement audio folder prefix */
10266
public static final String BATTERY_LEVEL_PREFIX = "battery/";
10367

10468
/**
105-
* Get battery level announcement audio file path.
106-
* Rounds to nearest 10% (10, 20, 30... 100).
69+
* Get battery level announcement audio file path. Rounds to nearest 10% (10, 20, 30... 100).
10770
*
10871
* @param percent Battery level 0-100
10972
* @return Asset path like "battery/50.mp3"
@@ -112,4 +75,4 @@ public static String getBatteryLevelAsset(int percent) {
11275
int rounded = Math.max(10, Math.min(100, ((percent + 5) / 10) * 10));
11376
return BATTERY_LEVEL_PREFIX + rounded + ".mp3";
11477
}
115-
}
78+
}

0 commit comments

Comments
 (0)