Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "checkmate" sound to robot voice #16220

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

Zinkelburger
Copy link
Contributor

Hello.
Previously the Robot voice was only able to say 'check', which was a little jarring.
Due to no signs of how the previous robot sound was generated, I used coqui-ai/TTS tacotron2.
The mp3 and ogg were generated from ffmpeg, not sure if they need some special compression.

To accommodate the new checkmate sound, I made symlinks in the sounds from "Check.mp3/ogg" → "Checkmate.mp3/ogg.
This follows the idea "Missing sounds are replaced with a symlink to another sound" which was suggested in #594.

I didn't regenerate the "Check" sound for robot, because although tacotron2 sounds great on Checkmate, its Check had a click I didn't like. The other models I tried sound better on Check, but worse on Checkmate. I can find a new model if its important to have the same voice.

Its likely I made some errors in the code, but the new sound does work in my dev environment.

Resolves issue #12004

- resolves issue lichess-org#12004
- Previous robot sound commit didn't mention the voice used. So I used
  [coqui-ai/TTS](https://github.com/coqui-ai/TTS)
- The voice comes from `tacotron2`
- Can be generated with the command: `tts --model_name
  "tts_models/en/ljspeech/tacotron2-DDC" --text "Checkmate"`
- Other non "robot" sounds have symlinks made from "Check.mp3/ogg" to
  "Checkmate.mp3/ogg", following the practice seen in lichess-org#594

Signed-off-by: Zinkelburger <[email protected]>
@ornicar ornicar merged commit bce53c8 into lichess-org:master Oct 14, 2024
3 checks passed
@Zinkelburger Zinkelburger deleted the add_checkmate_sound branch October 15, 2024 14:40
@TBestLittleHelper
Copy link
Contributor

It now says "victory" and "checkmate" at the same time. Not sure which one should have prefrence, or if both should be played with one delayed. But we probably don't want the sounds to overlap.

@Zinkelburger
Copy link
Contributor Author

Oh I see. I was only testing in the analysis board, not in a game.
If I do "play against the computer", I hear "checkmate" and "you lose" at the same time. That's my bad, I'll fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants