NurseCitizenDeveloper commited on
Commit
727a543
·
verified ·
1 Parent(s): 69793f3

Upload live_app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. live_app.py +2 -2
live_app.py CHANGED
@@ -4,7 +4,7 @@ This app provides live audio translation using the FastRTC library.
4
  Uses StreamHandlerBase for proper send-receive mode handling.
5
  """
6
 
7
- from fastrtc import Stream, StreamHandlerBase
8
  import numpy as np
9
  import tempfile
10
  import wave
@@ -30,7 +30,7 @@ def get_translator():
30
  return translator
31
 
32
  # --- StreamHandler Class for Real-Time Translation ---
33
- class LiveTranslationHandler(StreamHandlerBase):
34
  """
35
  StreamHandler for real-time audio translation.
36
  Receives audio chunks, accumulates, translates, and returns TTS audio.
 
4
  Uses StreamHandlerBase for proper send-receive mode handling.
5
  """
6
 
7
+ from fastrtc import Stream, StreamHandler
8
  import numpy as np
9
  import tempfile
10
  import wave
 
30
  return translator
31
 
32
  # --- StreamHandler Class for Real-Time Translation ---
33
+ class LiveTranslationHandler(StreamHandler):
34
  """
35
  StreamHandler for real-time audio translation.
36
  Receives audio chunks, accumulates, translates, and returns TTS audio.