Skip to content

SCUMM: Add text-to-speech (TTS)#6856

Merged
sev- merged 1 commit intoscummvm:masterfrom
ellm135:scumm-tts
Aug 21, 2025
Merged

SCUMM: Add text-to-speech (TTS)#6856
sev- merged 1 commit intoscummvm:masterfrom
ellm135:scumm-tts

Conversation

@ellm135
Copy link
Contributor

@ellm135 ellm135 commented Aug 3, 2025

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

  • Verbs
  • Sentences
  • Dialog options
  • Names of objects when hovered over
  • Original game menus
  • Subtitles, if speech is muted or not present
  • Pause banner

Currently only tested with demos.

Copy link
Contributor

@AndywinXp AndywinXp left a comment

Choose a reason for hiding this comment

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

Great job overall!

My review, admittedly, has been VERY pedantic, sorry about that.

The main points are:

  1. I'd like everything concerning the new code to be enclosed within the USE_TTS macro: this is because I'd like to see, on first sight, that what I'm seeing is not code available in the original executable but something external; this is of great help when debugging code side to side with the disassemblies of the original games, and surely will inform future developers of said thing.
  2. There are some new arguments in some functions; these have to be named as ttsArgName instead of argName, this is for the same reason stated above; I'm not sure I would like to have a double declaration within USE_TTS (I'll decide it and handle it later on my own, don't worry).

Again, sorry for being so pedantic, but this is to prevent situations during which we didn't know the provenience of certain pieces of code (it has happened before and caused us issues).

Thank you!

@AndywinXp
Copy link
Contributor

Oh, also, please beware of the build errors in Windows.

@AndywinXp AndywinXp added the GSoC Part of a Google Summer of Code project label Aug 3, 2025
@ellm135 ellm135 force-pushed the scumm-tts branch 3 times, most recently from 83a2212 to 31ccefb Compare August 3, 2025 12:51
@AndywinXp
Copy link
Contributor

Thank you for the great patience, looks great to me now!

@chkuendig
Copy link
Member

chkuendig commented Aug 6, 2025

edit: Reuploaded video, now with audio 🫠
I tried this out today as I recenly added TTS to the Emscripten port. I noticed a few things when testing two demos (video attached):

  • Indiana Jones and the Fate of Atlantis: Generally works well, it even correctly pronounces the copyright symbol. I'm not sure why the names are sometimes spelled out (but not always), but I presume that's because they are capitalized and neither ScummVM nor the TTS engine can distinguish that from an abbrevation.
  • Loom: Weirdly enough, the same copyright symbol now get's read out as "greater than". Later it completley seems to break down when the musical notes appear and it just keeps repeating "underscore"/"forward slash" despite neither of these characters being visible on the screen.
2025-08-06.21-56-15.mp4

Probably not huge issues, but I thought I document them as I found them. If we merge without fixing them I'm happy to file them in trac.

@chkuendig
Copy link
Member

chkuendig commented Aug 6, 2025

PS: I also tried Monkey Island and I found that there's a setting in the game that's missing from the other two Demos. Is this intended? They still played TTS even without that flag. (that could actually be a bug in my TTS backend - I'm not sure if the TTS backend has to check for that the toggle works in Monkey Island)
Screenshot 2025-08-06 at 21 35 38
Screenshot 2025-08-06 at 21 34 18
Screenshot 2025-08-06 at 21 34 13

@dwatteau
Copy link
Contributor

Hi @ellm135,

Thanks for your work and time on this.

You mentioned testing this on demos; does this mean you've tested it on all SCUMM demos we provide, or only a subset of it? If so, which one?

The idea would be to know if all main titles were tested, and if some of them require more thorough, collective testing.

In particular, to what extent were the non-English titles tested? I know from scummtr work (= SCUMM translation tool) that until SCUMM v7 or so, the games often used their own variants of old DOS code pages, i.e. you need some cpXXX character mapping (which seems to happen in this PR) but then some special characters may be at unexpected places -- and not only the copyright/trademark symbols, but possibly some diacritics and such, especially in the non-English releases.

There's also the case of Indy4 using a particular byte to make up a non-breaking space that's used very often in that game. I wonder how the TTS engine takes care of it.

Anyway: the end goal is to have a better idea on where to spend time and focus while testing this. In my opinion, it looks like we may need more testing on the non-English titles before merging this?

@ellm135
Copy link
Contributor Author

ellm135 commented Aug 11, 2025

Hi @ellm135,

Thanks for your work and time on this.

You mentioned testing this on demos; does this mean you've tested it on all SCUMM demos we provide, or only a subset of it? If so, which one?

The idea would be to know if all main titles were tested, and if some of them require more thorough, collective testing.

In particular, to what extent were the non-English titles tested? I know from scummtr work (= SCUMM translation tool) that until SCUMM v7 or so, the games often used their own variants of old DOS code pages, i.e. you need some cpXXX character mapping (which seems to happen in this PR) but then some special characters may be at unexpected places -- and not only the copyright/trademark symbols, but possibly some diacritics and such, especially in the non-English releases.

There's also the case of Indy4 using a particular byte to make up a non-breaking space that's used very often in that game. I wonder how the TTS engine takes care of it.

Anyway: the end goal is to have a better idea on where to spend time and focus while testing this. In my opinion, it looks like we may need more testing on the non-English titles before merging this?

I think I've tested it at least briefly with all major SCUMM demos provided on scummvm.org, though not necessarily different demos for the same game (for example, I tested the Full Throttle Mac demo a fair amount, but only briefly glanced at the DOS demo). I tested only a small number of Humongous Entertainment demos (Spy Fox: Dry Cereal, Putt-Putt Goes to the Moon, Freddi Fish 4, and Fatty Bear) because they didn't seem to have much or any text.

The only non-English titles I was able to test are the German translation of the Secret of Monkey Island's demo, the French and German translations of Day of the Tentacle's non-interactive demo, the German translation of Sam & Max's demo, and the Russian translation of Maniac Mansion's non-interactive demo. I tried a few non-English HE games, but I couldn't find any text (the subtitles seem to always be in English).

TTS for Indy4 appears to be working without issue where the non-breaking space appears. However, this may just be my system, or perhaps the encoding is replacing it with a character that my TTS voices as a space. I'm not sure if it will function correctly across versions, so I may try implementing a more direct replacement.

I think that more testing for non-English titles would be good, particularly because not many non-English titles have been tested so far, and there may be a fair number of encoding exceptions that currently aren't accounted for.

@dwatteau
Copy link
Contributor

OK, thanks for detailing this!

Then we're probably good for broader testing. To cover all the games, variants and localisations, we need feedback by end users, anyway.

LGTM, let's just see if @athrxx or @eriktorbjorn have any objection, as the PR does add some stuff.

And thanks for your work!

@sev-
Copy link
Member

sev- commented Aug 21, 2025

Thank you!

@sev- sev- merged commit 3b6d25d into scummvm:master Aug 21, 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.

5 participants