Skip to content

Commit b91b366

Browse files
Add transcription callback parameter to TranscriptionClient #361
1 parent 2375924 commit b91b366

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

whisper_live/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ class TranscriptionClient(TranscriptionTeeClient):
716716
no_speech_thresh (float, optional): Segments with no speech probability above this threshold will be discarded. Defaults to 0.45.
717717
clip_audio (bool, optional): Whether to clip audio with no valid segments. Defaults to False.
718718
same_output_threshold (int, optional): Number of repeated outputs before considering it as a valid segment. Defaults to 10.
719+
transcription_callback (callable, optional): A callback function to handle transcription results. Default is None.
719720
720721
Attributes:
721722
client (Client): An instance of the underlying Client class responsible for handling the WebSocket connection.
@@ -747,6 +748,7 @@ def __init__(
747748
no_speech_thresh=0.45,
748749
clip_audio=False,
749750
same_output_threshold=10,
751+
transcription_callback=None,
750752
):
751753
self.client = Client(
752754
host,
@@ -764,6 +766,7 @@ def __init__(
764766
no_speech_thresh=no_speech_thresh,
765767
clip_audio=clip_audio,
766768
same_output_threshold=same_output_threshold,
769+
transcription_callback=transcription_callback,
767770
)
768771

769772
if save_output_recording and not output_recording_filename.endswith(".wav"):

0 commit comments

Comments
 (0)