feat: add waveform generation and timeline display

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-21 11:12:36 -04:00
parent c96b0cedc9
commit e05e83f62f
8 changed files with 185 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
use crate::services::keyframe_index;
use crate::services::{keyframe_index, waveform_generator};
#[tauri::command]
pub async fn extract_keyframes(file_path: String) -> Result<Vec<f64>, String> {
@@ -6,3 +6,15 @@ pub async fn extract_keyframes(file_path: String) -> Result<Vec<f64>, String> {
.await
.map_err(|e| format!("Task failed: {e}"))?
}
#[tauri::command]
pub async fn extract_waveform(
file_path: String,
sample_count: usize,
) -> Result<Vec<f64>, String> {
tokio::task::spawn_blocking(move || {
waveform_generator::extract_waveform(&file_path, sample_count)
})
.await
.map_err(|e| format!("Task failed: {e}"))?
}