Repository navigation
DEV-1478: Shimmer Capture's microphone - audio recording, sound level, audio status - #354
Merged
Merged
Conversation
…, audio status The Java Shimmer Capture app gets the microphone half of shimmer-host-core's CAPTURE.md "Event markers and audio recording", on the driver calls DEV-1459 brought to master (#353) and the sound level channel from DEV-1413 (#346). - EventMarkersFrame, now "Event markers and audio": configuration byte 233's audio recording mode (Off, Fingerprint only, Fingerprint and raw audio, Raw audio only) and Sound Level, written with the whole configuration and read back, then an inquiry for the channel list; Read audio status from READY. - Raw audio records speech: Write asks first where the new mode keeps raw audio and the unit's own does not, and writes nothing on No. The driver's raw audio switch is set for that one write and put back. - MicrophoneSettings: byte 233's rules without Swing, so they are tested. - Device tab: the status's Recording audio and Audio fault flags where the unit records audio, and whether the firmware has the event markers and audio recording. - CaptureRulesTest: 11 tests, byte 233 as written checked on a ShimmerPC. - README. Co-Authored-By: Claude Opus 5.5 <[email protected]>
JongChern
marked this pull request as ready for review
November 16, 2026 04:22
harithjamadi
approved these changes
Nov 16, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Java Shimmer Capture app (
ShimmerPCBasicExamples,com.shimmerresearch.capture, DEV-1473 / #350) gets the microphone half of shimmer-host-core'sbindings/CAPTURE.mdsection "Event markers and audio recording". It uses the driver calls DEV-1459 brought to master in #353 (setAudioMode,getAudioModeToWrite,readAudioStatus,isAudioSupported, the audio flags) and the sound level channel from DEV-1413 (#346).Jira: DEV-1478.
What it adds
The window. The Stream tab's button is now Event markers and audio....
EventMarkersFramegets an Audio section for configuration byte 233:Sound_Levelchannel, offered from LogAndStream_Shimmer3R v1.01.026.Raw audio records speech. Where the new mode keeps raw audio and the unit's own (as last read) does not, Write asks first and writes nothing on No, as CAPTURE.md has it. The driver's
ShimmerObject.setRawAudioAllowedis process-wide, so it is set for that one write and put back. Without a yes,getAudioModeToWrite()writes the mode without the raw audio, as it does today. A unit that already keeps raw audio is not asked.MicrophoneSettings(new,simpleexamples, no Swing) holds byte 233's rules, so they are tested without a window.Device tab: the status's Recording audio and Audio fault flags beside the other nine where the unit records audio, and a line saying whether the firmware has the event markers (yes, no, not asked yet) and audio recording (yes, no).
EventMarkersFrameis shared withSensorMapsExample, which gets the Audio section too.Sound_Levelalready reached the plot's Other panel and the CSV through the driver; a test now holds the CSV columns, withNaN/-32768while the unit has no level yet.Tests
Unit tests.
./gradlew :test --tests 'com.shimmerresearch.capture.*'inShimmerPCBasicExamples: 26 pass, 11 of them new. The new ones check byte 233 as it would be written, on aShimmerPCread with a given byte 233: a raw mode with and without a yes, a unit that already keeps raw audio, the driver's raw audio switch put back, the sound level bit on v1.01.026 and not on v1.01.025, and the flags as shown. CI does not build this module.On the bench (2026-11-16): a Shimmer3R GSR+ (SR48.8.1) on LogAndStream v1.1.26, over Bluetooth Classic, driven through the code the window's buttons call. 34 of 35 checks passed:
Sound_Levelstreamed: 357 samples; the first 15 (about 0.3 s, while the level settles)NaNwith raw −32768, then 50.9 to 52.5 dB(A) in a quiet room. In the CSV asSound_Level_CAL,Sound_Level_RAWin dB(A). With Sound Level turned off, the next stream had noSound_Level.An earlier hand run in the window showed the raw audio question and its Yes writing 0x13.
To test
On a Shimmer3R with LogAndStream v1.01.026 or later that logs over Bluetooth.
./gradlew runCaptureinShimmerPCBasicExamples, pick the unit's COM port, Connect, then Event markers and audio... on the Stream tab.Sound_Levelappears in the Other panel. Record to CSV for a few seconds: the file hasSound_Level_CALandSound_Level_RAW.Sound_Levelis gone.Don't log with a raw mode unless everyone nearby has agreed: it records speech to the card.
Elsewhere
audio/files downloaded with their session (the driver has no SD card over Bluetooth).🤖 Generated with Claude Code