ThioJoe / Auto-Synced-Translated-Dubs

Automatically translates the text of a video based on a subtitle file, and then uses AI voice services to create a new dubbed & translated audio track where the speech is synced using the subtitle's timings.
GNU General Public License v3.0
1.56k stars 156 forks source link

Error in subtitles English translation #40

Closed Rovi23 closed 1 year ago

Rovi23 commented 1 year ago

Hi,

I'm trying to generate audios from Spanish to English, Portuguese, Russian and more and I'm having issues with the English translation. Only with the English version.

First lines of the original subtitles don't be translated in the first lines of the English .srt and it causes two situations: First TTS starts at an incorrect timestamp and last TTS finishs at the original timestamp. I show you (I will put errors with asterisks):

**00:00:07,958** --> 00:00:11,773
and while we were trying to steal the cheese from Mickey.exe

2
00:00:11,993 --> 00:00:17,078
Today while browsing Roblox, this game by Hungry Nora was recommended to me

(...)

115
00:09:54,599 --> 00:09:56,349
remember that if you have arrived new, subscribe and activate

116
00:09:56,349 --> **00:00:07,738**
the bell. a big hug and see you in the next videos guys Goodbye! **In the last days we have had enough complications while we were trying to steal Peppa Pig's food**

"Goodbye" is the last word in the original version, and "In the last days..." is the first sentence.

Original:

1
00:00:00,221 --> 00:00:04,194
En los últimos días hemos tenido bastantes complicaciones

2
00:00:04,454 --> 00:00:07,738
mientras intentábamos robarle la comida a Peppa Pig

(...)

261
00:09:57,793 --> 00:09:59,396
y nos vemos en los siguientes videos chicos

262
00:10:00,210 --> 00:10:01,407
Adios!

Am I doing something wrong?

Thanks!

ThioJoe commented 1 year ago

Hm it's definitely a bug, and I have an idea of what might be happening. I'll try to fix it this week.

I assume that when the program is looking to combine subtitle lines, and specifically the first line, it is mistakenly looking to the "previous" line which actually wraps around to the last one. I thought I had accounted for that but I guess I made an error.

ThioJoe commented 1 year ago

Could you provide the actual SRT subtitle file you're using? I want to see if it's a character encoding issue.

You can just drag it into the chat box to upload it

Rovi23 commented 1 year ago

Sure!

captions_2.zip

Rovi23 commented 1 year ago

Same issue with this original srt captions_445.zip

ThioJoe commented 1 year ago

I accidentally posted this in your other issue, but this fix may also help with that too.

I realized the function that was combining the subtitles was totally messed up. It should be fixed with the latest version, 0.9.1, so try that and let me know.