From 1ba1d2e41bce86d75266a511d4d13acd07828084 Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Mon, 28 Oct 2024 17:32:08 +0530 Subject: [PATCH 1/2] add fast_audio flag --- backend/voiceover/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/voiceover/views.py b/backend/voiceover/views.py index 1d074423..32b4b2e0 100644 --- a/backend/voiceover/views.py +++ b/backend/voiceover/views.py @@ -378,6 +378,7 @@ def get_payload(request): ) if voice_over.voice_over_type == "MACHINE_GENERATED": input_sentences = [] + fast_audio_threshold = 20 if task.target_language != "sa" else 16 for text, index in translation_payload: audio_index = str(start_offset + index) if audio_index in voice_over.payload["payload"].keys(): @@ -419,6 +420,7 @@ def get_payload(request): "audio" ], "audio_speed": 1, + "fast_audio": True if len(transcription_text)/t_d < fast_audio_threshold else False, } ) payload = {"payload": sentences_list} @@ -1031,7 +1033,7 @@ def save_voice_over(request): print("Saved IP Translation with inprogress") translation = inprogress_translation # Check if the transcript has a user - if task.user != request.user: + if task.user == request.user: return Response( {"message": "You are not allowed to update this voice_over."}, status=status.HTTP_400_BAD_REQUEST, From b0edcc0544a3f6c0d421ff38ebd2ab839cafe881 Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Mon, 28 Oct 2024 17:32:56 +0530 Subject: [PATCH 2/2] add fast_audio flag --- backend/voiceover/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/voiceover/views.py b/backend/voiceover/views.py index 32b4b2e0..b48fe4ca 100644 --- a/backend/voiceover/views.py +++ b/backend/voiceover/views.py @@ -1033,7 +1033,7 @@ def save_voice_over(request): print("Saved IP Translation with inprogress") translation = inprogress_translation # Check if the transcript has a user - if task.user == request.user: + if task.user != request.user: return Response( {"message": "You are not allowed to update this voice_over."}, status=status.HTTP_400_BAD_REQUEST,