Phase 2: Core transcription pipeline and audio playback
- Implement faster-whisper TranscribeService with word-level timestamps, progress reporting, and hardware auto-detection - Wire up Rust SidecarManager for Python process lifecycle (spawn, IPC, shutdown) - Add transcribe_file Tauri command bridging frontend to Python sidecar - Integrate wavesurfer.js WaveformPlayer with play/pause, skip, seek controls - Build TranscriptEditor with word-level click-to-seek and active highlighting - Connect file import flow: prompt → asset load → transcribe → display - Add typed tauri-bridge service with TranscriptionResult interface - Add Python tests for hardware detection and transcription result formatting Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,3 +37,49 @@ class HandlerRegistry:
|
||||
def ping_handler(msg: IPCMessage) -> IPCMessage:
|
||||
"""Simple ping handler for testing connectivity."""
|
||||
return IPCMessage(id=msg.id, type="pong", payload={"echo": msg.payload})
|
||||
|
||||
|
||||
def make_transcribe_handler() -> HandlerFunc:
|
||||
"""Create a transcription handler with a persistent TranscribeService."""
|
||||
from voice_to_notes.services.transcribe import TranscribeService, result_to_payload
|
||||
|
||||
service = TranscribeService()
|
||||
|
||||
def handler(msg: IPCMessage) -> IPCMessage:
|
||||
payload = msg.payload
|
||||
result = service.transcribe(
|
||||
request_id=msg.id,
|
||||
file_path=payload["file"],
|
||||
model_name=payload.get("model", "base"),
|
||||
device=payload.get("device", "cpu"),
|
||||
compute_type=payload.get("compute_type", "int8"),
|
||||
language=payload.get("language"),
|
||||
)
|
||||
return IPCMessage(
|
||||
id=msg.id,
|
||||
type="transcribe.result",
|
||||
payload=result_to_payload(result),
|
||||
)
|
||||
|
||||
return handler
|
||||
|
||||
|
||||
def hardware_detect_handler(msg: IPCMessage) -> IPCMessage:
|
||||
"""Detect hardware capabilities and return recommendations."""
|
||||
from voice_to_notes.hardware.detect import detect_hardware
|
||||
|
||||
info = detect_hardware()
|
||||
return IPCMessage(
|
||||
id=msg.id,
|
||||
type="hardware.info",
|
||||
payload={
|
||||
"has_cuda": info.has_cuda,
|
||||
"cuda_device_name": info.cuda_device_name,
|
||||
"vram_mb": info.vram_mb,
|
||||
"ram_mb": info.ram_mb,
|
||||
"cpu_cores": info.cpu_cores,
|
||||
"recommended_model": info.recommended_model,
|
||||
"recommended_device": info.recommended_device,
|
||||
"recommended_compute_type": info.recommended_compute_type,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user