Skip to content

Commit

Permalink
tested
Browse files Browse the repository at this point in the history
  • Loading branch information
0xzre committed Aug 16, 2024
1 parent 39d6268 commit c4c221b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/routers/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import opuslib

from utils.stt.deepgram_util import transcribe_file_deepgram, process_audio_dg, send_initial_file, \
get_speaker_audio_file, convert_audio_bytes_to_resampled_bytes
get_speaker_audio_file
from utils.stt.vad import vad_is_empty, VADIterator, model, is_speech_present

router = APIRouter()
Expand Down Expand Up @@ -75,7 +75,7 @@ async def _websocket_util(
transcript_socket2 = None
duration = 0
is_speech_active = False
speech_timeout = 0.7
speech_timeout = 0.7 # Good for now but better dynamically adjust it by user behaviour
last_speech_time = 0
try:
# single_file_path, duration = get_speaker_audio_file(uid) if language == 'en' else (None, 0)
Expand All @@ -93,7 +93,7 @@ async def _websocket_util(
await websocket.close()
return

threshold = 0.7
threshold = 0.6
vad_iterator = VADIterator(model, sampling_rate=sample_rate, threshold=threshold)
window_size_samples = 256 if sample_rate == 8000 else 512
if codec == 'opus':
Expand Down

0 comments on commit c4c221b

Please sign in to comment.