File size: 804 Bytes
2ffbd85
 
 
 
 
 
0d0b668
2ffbd85
 
0d0b668
2ffbd85
0d0b668
2ffbd85
 
 
 
0d0b668
 
2ffbd85
 
0d0b668
2ffbd85
 
 
0d0b668
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from __future__ import annotations

from typing import Any

try:
    from .config import VoiceRuntimeConfig
    from .transcription_groq import transcribe_groq
except ImportError:  # HF flat-root execution fallback
    from config import VoiceRuntimeConfig
    from transcription_groq import transcribe_groq

def transcribe(
    wav_path: str,
    config: VoiceRuntimeConfig,
    language_hint: str | None,
) -> tuple[list[Any], str, str]:
    segments, language, language_source, _ = transcribe_groq(wav_path, config, language_hint)
    return segments, language, language_source


def transcribe_with_metadata(
    wav_path: str,
    config: VoiceRuntimeConfig,
    language_hint: str | None,
) -> tuple[list[Any], str, str, dict[str, Any]]:
    return transcribe_groq(wav_path, config, language_hint)