Skip to content

Add voice macros.#50

Merged
zachlatta merged 2 commits intozachlatta:mainfrom
kunal2144:feat/voice-macros
Apr 4, 2026
Merged

Add voice macros.#50
zachlatta merged 2 commits intozachlatta:mainfrom
kunal2144:feat/voice-macros

Conversation

@kunal2144
Copy link
Copy Markdown

This pull request adds support for user-defined "Voice Macros" that allow users to bypass post-processing and immediately paste predefined text by speaking a custom voice command. The implementation includes persistent storage, UI for managing macros, and logic for detecting and applying macros during transcription.

Voice Macro Feature Implementation:

  • Added VoiceMacro and PrecomputedMacro types to represent user-defined macros and their normalized forms, and integrated them into AppState for storage and lookup. Voice macros are persisted in UserDefaults and precomputed for efficient matching.
  • Implemented logic in AppState to normalize transcripts and efficiently match them against user-defined macros, bypassing post-processing when a macro is triggered.

Settings UI Enhancements:

  • Added a new "Voice Macros" tab to the settings sidebar, with appropriate labeling and icon.
  • Created VoiceMacrosSettingsView and VoiceMacroEditorView for users to add, edit, and delete voice macros in the settings UI.

Persistence:

  • Voice macros are loaded from and saved to persistent storage (UserDefaults), ensuring they persist across app launches.

These changes collectively enable users to define custom voice commands that paste predefined text, improving workflow efficiency and customization.

@kunal2144 kunal2144 changed the title feat: add voice macros. Add Voice Macros. Mar 23, 2026
@kunal2144 kunal2144 changed the title Add Voice Macros. Add voice macros. Mar 23, 2026
@zachlatta
Copy link
Copy Markdown
Owner

Can you create a video of this working and show it working end-to-end?

@kunal2144
Copy link
Copy Markdown
Author

Here's the video: https://youtu.be/2o-5Pwn4Njg

@ojhurst
Copy link
Copy Markdown

ojhurst commented Apr 3, 2026

At the end of the video you deleted placeholder text and then you said placeholder text it should've worked. It should've literally said placeholder text isn't that right?

Also, I would like to see a test of speaking some words before the placeholder text then saying the placeholder text and then continuing on

@kunal2144
Copy link
Copy Markdown
Author

Yeah, it should’ve worked, but I’ve noticed that Freeflow tends to struggle with short phrases. That’s a bug, regardless of the voice macro feature.

In this case, it was using substring matching, which caused your scenario to fail. I’ve patched it so voice macros now trigger only on exact matches and added the fix to the PR.

@zachlatta zachlatta merged commit a8f9eba into zachlatta:main Apr 4, 2026
@zachlatta
Copy link
Copy Markdown
Owner

Thank you for this awesome PR!

@kunal2144
Copy link
Copy Markdown
Author

Thanks! Glad it helps!

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.

3 participants