@@ -82,7 +82,7 @@ def transcribe_chunks_streaming(client, audio_chunks, model: str, language_code:
82
82
data_bytes = chunk_len
83
83
)
84
84
audio_params = [(config (len (chunk )), RecognitionAudio (content = chunk )) for chunk in audio_chunks ]
85
- response = client .streaming_recognize_raw (audio_params , uuid = "" )
85
+ response = client .streaming_recognize_raw (audio_params , uuid = str ( random . randint ( 1000 , 100000 )) )
86
86
else :
87
87
audio = (RecognitionAudio (content = chunk ) for chunk in audio_chunks )
88
88
config = RecognitionConfig (
@@ -93,7 +93,7 @@ def transcribe_chunks_streaming(client, audio_chunks, model: str, language_code:
93
93
model = model ,
94
94
word_level = word_level
95
95
)
96
- response = client .streaming_recognize (config , audio , uuid = "" )
96
+ response = client .streaming_recognize (config , audio , uuid = str ( random . randint ( 1000 , 100000 )) )
97
97
except Exception as e :
98
98
traceback .print_exc ()
99
99
print (f'error: { str (e )} ' )
@@ -125,7 +125,7 @@ def audio_params_gen(audio_chunks):
125
125
for chunk in audio_chunks :
126
126
yield config (len (chunk )), RecognitionAudio (content = chunk )
127
127
128
- response_gen = client .bidi_streaming_recognize_raw (audio_params_gen (audio_chunks ), uuid = "" )
128
+ response_gen = client .bidi_streaming_recognize_raw (audio_params_gen (audio_chunks ), uuid = str ( random . randint ( 1000 , 100000 )) )
129
129
else :
130
130
config = RecognitionConfig (
131
131
sample_rate_hertz = sample_rate ,
@@ -140,7 +140,7 @@ def audio_chunks_gen(audio_chunks):
140
140
for chunk in audio_chunks :
141
141
yield RecognitionAudio (content = chunk )
142
142
143
- response_gen = client .bidi_streaming_recognize (config , audio_chunks_gen (audio_chunks ), uuid = "" )
143
+ response_gen = client .bidi_streaming_recognize (config , audio_chunks_gen (audio_chunks ), uuid = str ( random . randint ( 1000 , 100000 )) )
144
144
except Exception as e :
145
145
traceback .print_exc ()
146
146
print (f'error: { str (e )} ' )
0 commit comments