Skip to content

Commit

Permalink
add srt_file_path option
Browse files Browse the repository at this point in the history
  • Loading branch information
makaveli10 committed Feb 20, 2024
1 parent 2e9f67b commit dc22b7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions whisper_live/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def play_file(self, filename):
assert self.last_response_recieved
while time.time() - self.last_response_recieved < self.disconnect_if_no_response_for:
continue
self.send_packet_to_server(Client.END_OF_AUDIO.encode('utf-8')) # Ensure it's sent as bytes
self.send_packet_to_server(Client.END_OF_AUDIO.encode('utf-8'))
if self.server_backend == "faster_whisper":
self.write_srt_file(self.srt_file_path)
self.stream.close()
Expand Down Expand Up @@ -507,7 +507,7 @@ class TranscriptionClient:
```
"""
def __init__(self, host, port, lang=None, translate=False, model="small", use_vad=True):
self.client = Client(host, port, lang, translate, model, use_vad=use_vad)
self.client = Client(host, port, lang, translate, model, srt_file_path="output.srt", use_vad=use_vad)

def __call__(self, audio=None, hls_url=None):
"""
Expand Down

0 comments on commit dc22b7d

Please sign in to comment.