Custom Tones & Writing Styles
Relevant source files
The following files were used as context for generating this wiki page:
Custom Tones and Writing Styles in mausVoice are a core feature of the AI cleanup system, allowing users to define how their transcribed voice input is refined and formatted. By utilizing Large Language Models (LLMs) like Groq, the system removes filler words, applies punctuation, and restructures text according to specific stylistic guidelines or "tones" defined by the user or provided by the system.
Users can choose from predefined system styles such as "Polished," "Email," "Chat," or "Formal," or create their own custom styles to match specific workflows. These styles can be applied globally, manually toggled via hotkeys during dictation, or automatically triggered based on the specific application currently in focus.
Sources: README.md:58-60, apps/desktop/src/utils/tone.utils.ts:13-108, apps/desktop/src/components/styling/AppStylingLayout.tsx:61-72
System Tones Architecture
The system provides several built-in tones that serve as templates for LLM post-processing. Each tone consists of a promptTemplate which contains instructions for the AI on how to handle grammar, filler words, and specific formatting like lists or emojis.
Built-in Tone Definitions
| Tone ID | Name | Description | Key Capabilities |
|---|---|---|---|
default | Polished | Natural, well-written text preserving original voice. | Cleans grammar, removes fillers, keeps original meaning. |
verbatim | Verbatim | Exact transcription with no editing. | Disables all post-processing. |
email | Professional email formatting. | Adds greetings, body structure, and sign-offs. | |
chat | Chat | Casual, concise messaging style. | Removes over-punctuation, keeps personality. |
formal | Formal | Polished professional register. | Removes contractions, enforces precise vocabulary. |
Sources: apps/desktop/src/utils/tone.utils.ts:13-108
Tone Configuration Logic
The system distinguishes between "Template" tones (instructions for the AI) and "Style" tones (user-defined instructions). The ToneConfig type encapsulates these variations:
export type TemplateToneConfig = {
kind: "template";
promptTemplate: string;
systemPromptTemplate?: string;
};
export type StyleToneConfig = {
kind: "style";
stylePrompt: string;
};
export type ToneConfig = TemplateToneConfig | StyleToneConfig;
Sources: apps/desktop/src/utils/tone.utils.ts:223-234
Application-Specific Styling
Users can register specific desktop applications (e.g., Slack, Chrome) and assign a unique writing style to each. When an application is focused, mausVoice automatically switches to the assigned tone for all transcriptions within that context.
The AppStylingLayout handles the mapping between application target IDs and their assigned tones.
Sources: apps/desktop/src/components/styling/AppStylingLayout.tsx:23-55, apps/desktop/src/utils/tone.utils.ts:291-301
Manual Selection and Hotkey Cycling
In "Manual" styling mode, users can select one or more active styles to cycle through using global hotkeys while dictating. This allows for rapid switching between tones without leaving the target application.
Cycle Interaction Flow
AI Post-Processing Engine
The cleanup process involves building a specific prompt for the LLM based on the user's transcription, language, and selected tone. The system uses a JSON schema to ensure the AI returns a structured result.
Prompt Construction
The prompt generation logic combines the user's name, the dictation language, and the specific instructions from the tone.promptTemplate.
- System Prompt: Defines the persona and core rules (e.g., "Clean up transcript without changing meaning").
- User Prompt: Contains the raw transcript and specific formatting commands (e.g., "Format as Email").
- JSON Schema Enforcement: Ensures the response is a valid object containing the
resultfield.
Sources: apps/desktop/test/evals/post-processing-eval.test.ts:38-60, apps/desktop/src/utils/tone.utils.ts:20-50
Tone Management & UI
The ManualAddStyle component manages the user interface for selecting active tones. It allows users to toggle which styles are available for hotkey cycling and provides access to the ToneEditorDialog for creating custom prompt templates.
- Selection Constraint: At least one style must be selected at all times.
- Global/System Styles: Built-in or organization-managed styles (marked with
isGlobalorisSystem) cannot be edited by the user but can be toggled as active. - Custom Styles: Users can define new templates using the
Addaction, which invokesopenToneEditorDialog.
Sources: apps/desktop/src/components/styling/ManualAddStyle.tsx:32-118
Summary
Custom Tones & Writing Styles transform mausVoice from a simple dictation tool into a sophisticated writing assistant. By decoupling the transcription (what was said) from the styling (how it is written), the system enables professional-grade text generation across any desktop application. The architecture supports automated context-aware switching, manual hotkey cycling, and deep customization through LLM prompt engineering.
Sources: README.md:58-60, apps/desktop/src/utils/tone.utils.ts:13-108