Skip to content

MADE: Add text-to-speech (TTS)#6779

Merged
sev- merged 1 commit intoscummvm:masterfrom
ellm135:made-tts
Aug 9, 2025
Merged

MADE: Add text-to-speech (TTS)#6779
sev- merged 1 commit intoscummvm:masterfrom
ellm135:made-tts

Conversation

@ellm135
Copy link
Contributor

@ellm135 ellm135 commented Jun 27, 2025

Adds a toggle for text-to-speech to the game options.
Adds text-to-speech for the following:

  • Opening credits
  • Objects when hovered over
  • Menus
  • Tool use (map, photos, and tape recorder)
  • Location names
  • Notifications

Currently only tested with the Return to Zork DOS demos.
Translations for the opening credits (in pmvplayer.cpp) need verification.

@sev- sev- added the GSoC Part of a Google Summer of Code project label Jun 27, 2025
Copy link
Member

@sev- sev- left a comment

Choose a reason for hiding this comment

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

Added two small notes

@criezy
Copy link
Member

criezy commented Jul 14, 2025

With Return to Zork everything seems to work well, except for the crash I indicated.
But I also tested with the French version of Leather Goddesses of Phobos 2, and it doesn't work that well.

In that game dialogs are voiced and I am getting both TTS and the original voice, which is not great.
https://github.com/user-attachments/assets/8c587325-d418-471d-8f3f-9739252409eb

Also in the Play'O'Matic screen when I click on the different slots it always speak the text from the last one.
https://github.com/user-attachments/assets/cf29b6fc-e64a-4812-aebf-e59184b186f6

@ellm135 ellm135 force-pushed the made-tts branch 2 times, most recently from 4722a4a to e6031a6 Compare July 22, 2025 08:20
return true;
}
}

Copy link
Member

Choose a reason for hiding this comment

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

This function does not work for me because the text indices in my version are different from the one in lgop2PlayOMaticTextIndices

I have (French version) 14851, 15596, 15599, 15605, 15611, 15617, 15624, 15631, 15635, 15641, 15646, 15652, 15656, 15660, 15667, 15673, 15681, 15687, 15690, 15695, 15701.

I suspect these are not the only text indices that differ. Using those to identify the text in various places seems a bit fragile. But I don't really have a better idea. Maybe it would be better to check we are on the PlayOMatic screen and what the _textX and _textY values are instead of relying on the text indices?

Copy link
Contributor Author

@ellm135 ellm135 Jul 30, 2025

Choose a reason for hiding this comment

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

The other solution that I could think of that doesn't involve using text indices is using sprite indices. I think that this would probably work better across versions, but there are risks, like a sprite being used more than once in the game (which would make it a poor indicator for a unique piece of text) or the chance that there isn't a sprite drawn before a specific piece of text is printed. Because of this, while I did switch over the Play'O'Matic text to rely more on the sprite index, which should fix the crash, I left the others unchanged for now. Would it be preferred to switch to using sprite indices?

Copy link
Member

Choose a reason for hiding this comment

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

It might be better. Currently none of the code that relies on the text indices is working for me in LGOP.

For example:

// 13484 is the "over a decade of the best interactive fiction" line in the beginning, which has no voiceover
// 14185 is the "choose your character" message, and 13876 is the copyright message in the intro

Those are 14851 and 15589 respectively for me. So that don't get voiced currently.

@sev-
Copy link
Member

sev- commented Aug 9, 2025

Thanks!

@sev- sev- merged commit cdc2b11 into scummvm:master Aug 9, 2025
10 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.

3 participants