Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
import httpx
import websockets

from advanced_omi_backend.config_loader import get_backend_config
from advanced_omi_backend.model_registry import get_models_registry
from .base import BaseTranscriptionProvider, BatchTranscriptionProvider, StreamingTranscriptionProvider

from .base import (
BaseTranscriptionProvider,
BatchTranscriptionProvider,
StreamingTranscriptionProvider,
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -148,9 +154,15 @@ async def transcribe(self, audio_data: bytes, sample_rate: int, diarize: bool =
words = _dotted_get(data, extract.get("words")) or []
segments = _dotted_get(data, extract.get("segments")) or []

# Ignore segments from all providers - speaker service creates them via diarization
segments = []
logger.debug(f"Transcription: Extracted {len(words)} words, ignoring provider segments (speaker service will create them)")
# Check config to decide whether to keep or discard provider segments
transcription_config = get_backend_config("transcription")
use_provider_segments = transcription_config.get("use_provider_segments", False)

if not use_provider_segments:
segments = []
logger.debug(f"Transcription: Extracted {len(words)} words, ignoring provider segments (use_provider_segments=false)")
else:
logger.debug(f"Transcription: Extracted {len(words)} words, keeping {len(segments)} provider segments (use_provider_segments=true)")

return {"text": text, "words": words, "segments": segments}

Expand Down
186 changes: 110 additions & 76 deletions backends/advanced/src/advanced_omi_backend/workers/transcription_jobs.py

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions backends/advanced/webui/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
import { AuthProvider } from './contexts/AuthContext'
import { ThemeProvider } from './contexts/ThemeContext'
import { RecordingProvider } from './contexts/RecordingContext'
import Layout from './components/layout/Layout'
import LoginPage from './pages/LoginPage'
import Chat from './pages/Chat'
Expand Down Expand Up @@ -28,7 +29,8 @@ function App() {
<ErrorBoundary>
<ThemeProvider>
<AuthProvider>
<Router basename={basename} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
<RecordingProvider>
<Router basename={basename} future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
<Routes>
<Route path="/login" element={<LoginPage />} />
<Route path="/" element={
Expand Down Expand Up @@ -103,7 +105,8 @@ function App() {
} />
</Route>
</Routes>
</Router>
</Router>
</RecordingProvider>
</AuthProvider>
</ThemeProvider>
</ErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SimpleAudioRecordingReturn } from '../../hooks/useSimpleAudioRecording'
import { RecordingContextType } from '../../contexts/RecordingContext'

interface SimpleDebugPanelProps {
recording: SimpleAudioRecordingReturn
recording: RecordingContextType
}

export default function SimpleDebugPanel({ recording }: SimpleDebugPanelProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Mic, MicOff, Loader2 } from 'lucide-react'
import { SimpleAudioRecordingReturn } from '../../hooks/useSimpleAudioRecording'
import { RecordingContextType } from '../../contexts/RecordingContext'

interface SimplifiedControlsProps {
recording: SimpleAudioRecordingReturn
recording: RecordingContextType
}

const getStepText = (step: string): string => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import { Check, Loader2, AlertCircle, Mic, Wifi, Play, Radio } from 'lucide-react'
import { SimpleAudioRecordingReturn, RecordingStep } from '../../hooks/useSimpleAudioRecording'
import { RecordingContextType, RecordingStep } from '../../contexts/RecordingContext'

interface StatusDisplayProps {
recording: SimpleAudioRecordingReturn
recording: RecordingContextType
}

interface StepInfo {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { useNavigate, useLocation } from 'react-router-dom'
import { Radio, Square, Zap, Archive } from 'lucide-react'
import { useRecording } from '../../contexts/RecordingContext'

export default function GlobalRecordingIndicator() {
const navigate = useNavigate()
const location = useLocation()
const { isRecording, recordingDuration, mode, stopRecording, formatDuration } = useRecording()

// Don't show if not recording
if (!isRecording) return null

// Don't show on the Live Record page (it has its own UI)
if (location.pathname === '/live-record') return null

return (
<div className="flex items-center gap-3 px-3 py-1.5 bg-red-50 dark:bg-red-900/30 border border-red-200 dark:border-red-800 rounded-lg">
{/* Pulsing red dot */}
<div className="relative flex items-center">
<span className="absolute inline-flex h-3 w-3 rounded-full bg-red-400 opacity-75 animate-ping" />
<span className="relative inline-flex h-3 w-3 rounded-full bg-red-500" />
</div>

{/* Recording info */}
<div className="flex items-center gap-2 text-sm">
<span className="font-medium text-red-700 dark:text-red-300">
{formatDuration(recordingDuration)}
</span>
<span className="text-red-600 dark:text-red-400 flex items-center gap-1">
{mode === 'streaming' ? (
<>
<Zap className="h-3 w-3" />
<span>Streaming</span>
</>
) : (
<>
<Archive className="h-3 w-3" />
<span>Batch</span>
</>
)}
</span>
</div>

{/* Actions */}
<div className="flex items-center gap-1.5 ml-1">
{/* Navigate to Live Record */}
<button
onClick={() => navigate('/live-record')}
className="p-1.5 rounded hover:bg-red-100 dark:hover:bg-red-800/50 transition-colors text-red-600 dark:text-red-400"
title="Go to Live Record"
>
<Radio className="h-4 w-4" />
</button>

{/* Stop button */}
<button
onClick={stopRecording}
className="p-1.5 rounded bg-red-600 hover:bg-red-700 transition-colors text-white"
title="Stop Recording"
>
<Square className="h-4 w-4" />
</button>
</div>
</div>
)
}
6 changes: 5 additions & 1 deletion backends/advanced/webui/src/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Link, useLocation, Outlet } from 'react-router-dom'
import { Music, MessageSquare, MessageCircle, Brain, Users, Upload, Settings, LogOut, Sun, Moon, Shield, Radio, Layers, Calendar, Puzzle, Zap } from 'lucide-react'
import { useAuth } from '../../contexts/AuthContext'
import { useTheme } from '../../contexts/ThemeContext'
import GlobalRecordingIndicator from './GlobalRecordingIndicator'

export default function Layout() {
const location = useLocation()
Expand Down Expand Up @@ -37,14 +38,17 @@ export default function Layout() {
</h1>
</div>
<div className="flex items-center space-x-4">
{/* Global Recording Indicator */}
<GlobalRecordingIndicator />

<button
onClick={toggleTheme}
className="p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-gray-600 dark:text-gray-300"
aria-label="Toggle theme"
>
{isDark ? <Sun className="h-5 w-5" /> : <Moon className="h-5 w-5" />}
</button>

{/* User info */}
<div className="flex items-center space-x-2 text-sm text-gray-700 dark:text-gray-300">
<div className="flex items-center space-x-1">
Expand Down
Loading
Loading