Skip to content

Commit

Permalink
Expose the srt file location of Transcription client
Browse files Browse the repository at this point in the history
  • Loading branch information
chien-liu authored and chien-liu committed May 31, 2024
1 parent e1a42c2 commit cfba5b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions whisper_live/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ class TranscriptionClient(TranscriptionTeeClient):
translate (bool, optional): Indicates whether translation tasks are required (default is False).
save_output_recording (bool, optional): Indicates whether to save recording from microphone.
output_recording_filename (str, optional): File to save the output recording.
output_transcription_path (str, optional): File to save the output transcription.
Attributes:
client (Client): An instance of the underlying Client class responsible for handling the WebSocket connection.
Expand All @@ -662,11 +663,14 @@ def __init__(
model="small",
use_vad=True,
save_output_recording=False,
output_recording_filename="./output_recording.wav"
output_recording_filename="./output_recording.wav",
output_transcription_path="./output.srt"
):
self.client = Client(host, port, lang, translate, model, srt_file_path="output.srt", use_vad=use_vad)
self.client = Client(host, port, lang, translate, model, srt_file_path=output_transcription_path, use_vad=use_vad)
if save_output_recording and not output_recording_filename.endswith(".wav"):
raise ValueError(f"Please provide a valid `output_recording_filename`: {output_recording_filename}")
if not output_transcription_path.endswith(".srt"):
raise ValueError(f"Please provide a valid `output_transcription_path`: {output_transcription_path}. The file extension should be `.srt`.")
TranscriptionTeeClient.__init__(
self,
[self.client],
Expand Down

0 comments on commit cfba5b3

Please sign in to comment.