Spaces:
Sleeping
Sleeping
AshDavid12
commited on
Commit
·
c5f73dc
1
Parent(s):
49c6a26
file index counter fix
Browse files- client.py +1 -1
- downloaded_audio.wav +1 -0
- infer.py +2 -1
client.py
CHANGED
@@ -19,7 +19,7 @@ async def send_audio(websocket):
|
|
19 |
for chunk in response.iter_content(chunk_size=1024): # Stream in chunks
|
20 |
if chunk:
|
21 |
audio_buffer.extend(chunk)
|
22 |
-
print(f"Received audio chunk of size {len(chunk)} bytes.")
|
23 |
|
24 |
# Send buffered audio data once it's large enough
|
25 |
if len(audio_buffer) >= buffer_size:
|
|
|
19 |
for chunk in response.iter_content(chunk_size=1024): # Stream in chunks
|
20 |
if chunk:
|
21 |
audio_buffer.extend(chunk)
|
22 |
+
#print(f"Received audio chunk of size {len(chunk)} bytes.")
|
23 |
|
24 |
# Send buffered audio data once it's large enough
|
25 |
if len(audio_buffer) >= buffer_size:
|
downloaded_audio.wav
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"error":"File not found"}
|
infer.py
CHANGED
@@ -195,6 +195,7 @@ async def websocket_transcribe(websocket: WebSocket):
|
|
195 |
#temp_audio_filename = os.path.basename(temp_audio_file.name)
|
196 |
output_directory = "/tmp"
|
197 |
os.makedirs(output_directory, exist_ok=True)
|
|
|
198 |
|
199 |
while True:
|
200 |
try:
|
@@ -204,7 +205,7 @@ async def websocket_transcribe(websocket: WebSocket):
|
|
204 |
logging.warning("Received empty audio chunk, skipping processing hey.")
|
205 |
continue
|
206 |
|
207 |
-
|
208 |
# Create a new file for the chunk
|
209 |
chunk_filename = os.path.join(output_directory, f"audio_chunk_{chunk_counter}.wav")
|
210 |
chunk_counter += 1
|
|
|
195 |
#temp_audio_filename = os.path.basename(temp_audio_file.name)
|
196 |
output_directory = "/tmp"
|
197 |
os.makedirs(output_directory, exist_ok=True)
|
198 |
+
chunk_counter = 0
|
199 |
|
200 |
while True:
|
201 |
try:
|
|
|
205 |
logging.warning("Received empty audio chunk, skipping processing hey.")
|
206 |
continue
|
207 |
|
208 |
+
|
209 |
# Create a new file for the chunk
|
210 |
chunk_filename = os.path.join(output_directory, f"audio_chunk_{chunk_counter}.wav")
|
211 |
chunk_counter += 1
|