Skip to content

feat(v2): make saving audio recordings optional - #150

Open
SinhSinhAn wants to merge 3 commits into
karansinghgit:mainfrom
SinhSinhAn:feat/optional-audio-history
Open

SinhSinhAn wants to merge 3 commits into
karansinghgit:mainfrom
SinhSinhAn:feat/optional-audio-history

Conversation

@SinhSinhAn

@SinhSinhAn SinhSinhAn commented Sep 21, 2026 •

Copy link
Copy Markdown

SpeakType saves audio for every successful dictation. This adds Settings → General → Privacy → Save audio recordings, allowing users to keep transcripts and statistics without retaining new recordings.

The setting defaults to enabled, including for older settings files. When disabled, the pipeline skips the WAV write and saves history without an audio path. Existing recordings remain available, as explained beside the toggle. The pipeline uses the settings snapshot captured when transcription starts; setting changes apply to subsequent transcriptions.

Fixes #114. Also addresses the identical request in #115.

Validation

  • macOS Apple Silicon: cargo test --locked — 79 tests pass.
  • cargo clippy --all-targets --locked -- -D warnings and cargo fmt --check pass.
  • npm run typecheck, npm test (13 tests), and npm run build pass.
  • Browser preview: checked the toggle in both directions, navigation away and back, light/dark themes, and transcript-only history without playback controls.

Regression tests cover no recording files when disabled, transcript/statistics persistence, preservation of existing recordings, audio saving when enabled, and transcript saving after an audio-write failure. WAV format validation remains covered by the existing media tests. Settings tests cover persistence, older-file defaults, and the frontend field name.

Native microphone dictation, real playback, Windows, and Linux were not exercised. Browser checks use sample data; Rust tests exercise actual settings/history persistence on disk. A manual retention check is included in the contribution guide.

RED: cargo test --lib --locked reports the missing save_audio_recordings field and retention argument; dependencies compile successfully.
GREEN: cargo test --lib --locked passes, including retention, legacy defaults and settings persistence. Skip WAV writes when disabled and preserve transcript history and statistics.
@karansinghgit

Copy link
Copy Markdown
Owner

Nice work, this is close. The design is right: gating inside save_recording means no write path can bypass the setting, existing recordings are left alone, and History and the Dashboard already hide playback when an item has no audio, so transcript-only items render cleanly. All three settings mirrors are updated, and the default keeps saving on for existing installs.

Three things before I merge:

  1. Add a CHANGELOG entry. Every user-visible change goes in [Unreleased], and a privacy toggle belongs there.
  2. Drop the second settings read in pipeline.rs. run already has a settings snapshot from the top of the function; reading again clones the whole Settings (dictionary included) for one bool, and leaves the function working from two different snapshots. The race it avoids is a few milliseconds wide.
  3. Switch label="Save audio recordings" is for switches with no visible label. Inside a SettingRow the label is already visible, so drop it, as the other rows in that tab do.

Two optional ones: the neighbouring rows swap their description depending on the setting's value, and the test asserting WAV sample rate and length is already covered in media.rs.

Worth calling out: using a file where the recordings folder should be, to force a write failure, is a neat way to pin down that a transcript survives a failed audio write.

One follow-up for later, not for this PR: turning the setting off leaves previously saved recordings on disk, and the only way to remove them is Clear all history, which also deletes transcripts. Issue #114 is about sensitive dictations, so a "delete existing recordings" action would close that loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to not save the audio with the history

2 participants