collabora / WhisperLive

A nearly-live implementation of OpenAI's Whisper.
MIT License
2.09k stars 283 forks source link

Expose the srt file location of Transcription client #224

Closed chien-liu closed 5 months ago

chien-liu commented 5 months ago

Description

This pull request addresses issue #183. The feature request is to customize the location of the client transcription.

Changes Made

Added an argument to TranscriptionClient to specify the location where the transcription file should be saved.

Example Code

from whisper_live.client import TranscriptionClient

client = TranscriptionClient(
    "localhost",
    9090,
    lang="en",
    translate=False,
    model="small",
    use_vad=False,
    output_transcription_path="my_customized_output.srts"    # Specify the location of transcription
)

client(
    hls_url="http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_1xtra/bbc_1xtra.isml/bbc_1xtra-audio%3d96000.norewind.m3u8")

Issue Reference

Fixes #183