Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
v1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
overcrash66 committed Dec 23, 2023
1 parent b3e5ca8 commit 73c76ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions AudioFileTranslator-S2ST.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,17 @@ def process_audio_chunk(self, input_path, target_language, chunk_idx, output_pat
if target_language != "en":
translator = SentenceTranslator(src="en", dst=target_language)
translated_text = translator(transcription)

#fix a bug: Text Validation check if we have duplicate successive words
words = translated_text.split()
cleaned_words = [words[0]]

for word in words[1:]:
if word != cleaned_words[-1]:
cleaned_words.append(word)

cleaned_str = ' '.join(cleaned_words)
translated_text = cleaned_str

# Generate final audio output from translated text
self.generate_audio(translated_text, Translation_chunk_output_path, target_language)
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Audio file translator, Speech To Speech Translator is a tool that allows you to
- v1.7 - New GUI updates.
- V1.8 - Some Youtube Downloader fixes and improvements.
- V1.9 - Add a tool who replaces mp4 Video file Audio with translation audio file. (Go to: file > Replace Audio in Video)
- Improve text translation by fixing a bug of duplicate successive words.

## Requirements

Expand Down

0 comments on commit 73c76ca

Please sign in to comment.