@@ -30,6 +30,7 @@ def __init__(
30
30
model = "small" ,
31
31
srt_file_path = "output.srt" ,
32
32
use_vad = True ,
33
+ use_wss = False ,
33
34
log_transcription = True ,
34
35
max_clients = 4 ,
35
36
max_connection_time = 600 ,
@@ -72,6 +73,7 @@ def __init__(
72
73
self .server_error = False
73
74
self .srt_file_path = srt_file_path
74
75
self .use_vad = use_vad
76
+ self .use_wss = use_wss
75
77
self .last_segment = None
76
78
self .last_received_segment = None
77
79
self .log_transcription = log_transcription
@@ -88,7 +90,8 @@ def __init__(
88
90
self .audio_bytes = None
89
91
90
92
if host is not None and port is not None :
91
- socket_url = f"ws://{ host } :{ port } "
93
+ socket_protocol = 'wss' if self .use_wss else "ws"
94
+ socket_url = f"{ socket_protocol } ://{ host } :{ port } "
92
95
self .client_socket = websocket .WebSocketApp (
93
96
socket_url ,
94
97
on_open = lambda ws : self .on_open (ws ),
@@ -721,6 +724,7 @@ def __init__(
721
724
translate = False ,
722
725
model = "small" ,
723
726
use_vad = True ,
727
+ use_wss = False ,
724
728
save_output_recording = False ,
725
729
output_recording_filename = "./output_recording.wav" ,
726
730
output_transcription_path = "./output.srt" ,
@@ -741,6 +745,7 @@ def __init__(
741
745
model ,
742
746
srt_file_path = output_transcription_path ,
743
747
use_vad = use_vad ,
748
+ use_wss = use_wss ,
744
749
log_transcription = log_transcription ,
745
750
max_clients = max_clients ,
746
751
max_connection_time = max_connection_time ,
0 commit comments