core/transcribe.py

CLI-Anything · videocaptioner/agent-harness/cli_anything/videocaptioner/core/transcribe.py · python · Apache-2.0
voice, tag:knn-classified

Transcribes audio/video to subtitles using various ASR engines.

# Source: https://github.com/HKUDS/CLI-Anything | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Transcription — speech to subtitles via ASR engines."""

from cli_anything.videocaptioner.utils.vc_backend import run_quiet


def transcribe(
    input_path: str,
    output_path: str | None = None,
    asr: str = "bijian",
    language: str = "auto",
    format: str = "srt",
    word_timestamps: bool = False,
    whisper_api_key: str | None = None,
    whisper_api_base: str | None = None,
    whisper_model: str | None = None,
) -> str:
    """Transcribe audio/video to subtitles.

    Args:
        input_path: Audio or video file path.
        output_path: Output file or directory pat

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key