Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src-tauri/src/audio_toolkit/audio/recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ fn run_consumer(
let mut recording = false;

// ---------- spectrum visualisation setup ---------------------------- //
const BUCKETS: usize = 16;
const BUCKETS: usize = 25;
const WINDOW_SIZE: usize = 512;
let mut visualizer = AudioVisualiser::new(
in_sample_rate,
WINDOW_SIZE,
BUCKETS,
400.0, // vocal_min_hz
4000.0, // vocal_max_hz
150.0, // vocal_min_hz
2500.0, // vocal_max_hz
);

fn handle_frame(
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ pub fn run() {
)
.expect("Failed to export typescript bindings");

let mut builder = tauri::Builder::default().plugin(
let builder = tauri::Builder::default().plugin(
LogBuilder::new()
.level(log::LevelFilter::Trace) // Set to most verbose level globally
.max_file_size(500_000)
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/shortcut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::managers::audio::AudioRecordingManager;
use crate::settings::ShortcutBinding;
use crate::settings::{
self, get_settings, ClipboardHandling, LLMPrompt, OverlayPosition, PasteMethod, SoundTheme,
APPLE_INTELLIGENCE_DEFAULT_MODEL_ID, APPLE_INTELLIGENCE_PROVIDER_ID,
APPLE_INTELLIGENCE_PROVIDER_ID,
};
use crate::tray;
use crate::ManagedToggleState;
Expand Down
31 changes: 22 additions & 9 deletions src/overlay/RecordingOverlay.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
.recording-overlay {
height: 36px;
height: 40px;
width: 172px;
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
padding: 6px;
background: #000000cc;
border-radius: 18px;
border-radius: 22px;
opacity: 0;
transition: opacity 300ms ease-out;
box-sizing: border-box;
transform: translateZ(0);
-webkit-transform: translateZ(0);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
isolation: isolate;
}

.overlay-left {
Expand All @@ -31,21 +36,29 @@

.bars-container {
display: flex;
align-items: end;
align-items: center;
justify-content: center;
gap: 3px;
gap: 2px;
padding-top: 2px;
padding-bottom: 0px;
height: 24px;
overflow: hidden;
background: transparent;
isolation: auto;
filter: none;
contain: layout style;
}

.bar {
width: 6px;
width: 2px;
background: #ffe5ee;
max-height: 20px;
border-radius: 2px;
transition: height 80ms linear;
max-height: 50px;
border-radius: 10px;
min-height: 4px;
transition: height 80ms linear;
transform: translateZ(0);
-webkit-transform: translateZ(0);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}

.recording-overlay.fade-in {
Expand Down
11 changes: 7 additions & 4 deletions src/overlay/RecordingOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ const RecordingOverlay: React.FC = () => {
});

smoothedLevelsRef.current = smoothed;
setLevels(smoothed.slice(0, 9));

// Symmetric mirror effect for Apple-like visualization
const half = smoothed.slice(0, 12);
const symmetricLevels = [...half.slice().reverse(), ...half];
setLevels(symmetricLevels);
});

// Cleanup function
Expand Down Expand Up @@ -80,9 +84,8 @@ const RecordingOverlay: React.FC = () => {
key={i}
className="bar"
style={{
height: `${Math.min(20, 4 + Math.pow(v, 0.7) * 16)}px`, // Cap at 20px max height
transition: "height 60ms ease-out, opacity 120ms ease-out",
opacity: Math.max(0.2, v * 1.7), // Minimum opacity for visibility
height: `${Math.min(50, 4 + Math.pow(v, 0.7) * 32)}px`,
opacity: Math.max(0.3, Math.min(1, v * 1.5)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove the transitions? This otherwise causes some flickering.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, i forgot to put it back in the CSS because keeping it in the TSX made some ghosting artefacts on top of the bars and moving it to CSS fixed the issue.

}}
/>
))}
Expand Down