Skip to content

TEENAGENT: Fix Russian TTS encoding#6722

Merged
criezy merged 1 commit intoscummvm:masterfrom
ellm135:teen-tts
Jun 19, 2025
Merged

TEENAGENT: Fix Russian TTS encoding#6722
criezy merged 1 commit intoscummvm:masterfrom
ellm135:teen-tts

Conversation

@ellm135
Copy link
Contributor

@ellm135 ellm135 commented Jun 15, 2025

Fixes text-to-speech for the Russian translation, which uses a custom encoding.

@sev- sev- added the GSoC Part of a Google Summer of Code project label Jun 16, 2025

Common::U32String TeenAgentEngine::convertCyrillic(const Common::String &text) const {
const byte *bytes = (const byte *)text.c_str();
byte result[10240];
Copy link
Member

@bluegr bluegr Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need a fixed size in this buffer? You already know the length of the original text, can't you deduce the buffer length from that?

i.e:

Suggested change
byte result[10240];
char *result = new char[bytes.size() * 2 + 1];
(...)
result[i] = 0;
(...)
Common::U32String res(result);
delete[] result;
return res;

@criezy
Copy link
Member

criezy commented Jun 16, 2025

This seems fine. The one check that failed in a compilation error in the lastexpress engine, so not relevant.
But I would like a Russian speaker to validate that this is indeed correct. To help with this I recorded a part of the intro sequence with TTS enabled: https://youtu.be/yjPL7d0K9jg

@criezy
Copy link
Member

criezy commented Jun 19, 2025

Thank you.
@sev- verified the speech is correct.

@criezy criezy merged commit b74e7a7 into scummvm:master Jun 19, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Part of a Google Summer of Code project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants