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

TTS port fix #7

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open

TTS port fix #7

wants to merge 40 commits into from

Conversation

Perohai
Copy link

@Perohai Perohai commented Jan 9, 2025

About the pull request

Добил пр пупса, ттс проигрывается.
Перенес sshttp на км-ы, немножко подредактировал под него silero dm и http dm + по мелочи.
Ттс (токен, url, включен или нет) настраиваются внутри text_to_speech/code/configuration.dm

Explain why it's good for the game

Так звучит мой голос

Testing Photographs and Procedure

ОСТОРОЖНО ГРОМКИЙ ЗВУК
ОСТОРОЖНО ГРОМКИЙ ЗВУК
ОСТОРОЖНО ГРОМКИЙ ЗВУК
Локальный сервак всрато настроился

freecompress-Desktop_2024.12.31_-_03.34.12.01.mp4
Screenshots & Videos

Put screenshots and videos here with an empty line between the screenshots and the <details> tags.

Changelog

🆑
fix: TTS System
/:cl:

Summary by Sourcery

Implement a text-to-speech (TTS) system using the Silero model. Configure the TTS settings (token, URL, enabled status) within text_to_speech/code/configuration.dm.

New Features:

  • Add a text-to-speech (TTS) system.

Tests:

  • Update tests for the new TTS system.

PhantornRU and others added 30 commits November 2, 2024 00:18
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->

# About the pull request

ss220club/Bandastation#1

# Explain why it's good for the game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding, and may discourage maintainers from reviewing or merging
your PR. This section is not strictly required for (non-controversial)
fix PRs or backend PRs. -->


# Testing Photographs and Procedure
<!-- Include any screenshots/videos/debugging steps of the modified code
functioning successfully, ideally including edge cases. -->

<!-- !! If you are modifying sprites, you **must** include one or more
in-game screenshots or videos of the new sprites. !! -->

<details>
<summary>Screenshots & Videos</summary>


![image](https://github.com/user-attachments/assets/e5211faa-ee03-43af-8002-6f81f48a0df8)



</details>


# Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
label your changes in the changelog. Please note that maintainers freely
reserve the right to remove and add tags should they deem it
appropriate. You can attempt to finagle the system all you want, but
it's best to shoot for clear communication right off the bat. -->
<!-- If you add a name after the ':cl', that name will be used in the
changelog. You must add your CKEY after the CL if your GitHub name
doesn't match. Maintainers freely reserve the right to remove and add
tags should they deem it appropriate. -->

:cl:
add: Порт системы модуля с бандастейшин
/:cl:

<!-- Both :cl:'s are required for the changelog to work! -->
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->

# About the pull request

Портируем вспомогательные паки: Дефайны, хелперы, сигналлеры и
синглтоны.

# Explain why it's good for the game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding, and may discourage maintainers from reviewing or merging
your PR. This section is not strictly required for (non-controversial)
fix PRs or backend PRs. -->


# Testing Photographs and Procedure
<!-- Include any screenshots/videos/debugging steps of the modified code
functioning successfully, ideally including edge cases. -->

<!-- !! If you are modifying sprites, you **must** include one or more
in-game screenshots or videos of the new sprites. !! -->

<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
label your changes in the changelog. Please note that maintainers freely
reserve the right to remove and add tags should they deem it
appropriate. You can attempt to finagle the system all you want, but
it's best to shoot for clear communication right off the bat. -->
<!-- If you add a name after the ':cl', that name will be used in the
changelog. You must add your CKEY after the CL if your GitHub name
doesn't match. Maintainers freely reserve the right to remove and add
tags should they deem it appropriate. -->

:cl:
add: Порт вспомогательных паков
/:cl:

<!-- Both :cl:'s are required for the changelog to work! -->
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->

# About the pull request

Добавлена возможность говорить на родном русском языке.
Документы могут тоже "говорить" на русском.
Всякие приставки и прочие текстовые обозначения должны быть тоже на
русском.

Да, хардкодом.

# Explain why it's good for the game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding, and may discourage maintainers from reviewing or merging
your PR. This section is not strictly required for (non-controversial)
fix PRs or backend PRs. -->


# Testing Photographs and Procedure
<!-- Include any screenshots/videos/debugging steps of the modified code
functioning successfully, ideally including edge cases. -->

<!-- !! If you are modifying sprites, you **must** include one or more
in-game screenshots or videos of the new sprites. !! -->


![image](https://github.com/user-attachments/assets/635f35a6-d87f-46fe-9b06-1ee6e48ecea5)


![image](https://github.com/user-attachments/assets/9d0fd9aa-7f15-4ed2-b018-bdfcce384a84)


![image](https://github.com/user-attachments/assets/70f23d7a-e2d9-4ea1-9df5-bec22538661d)


![image](https://github.com/user-attachments/assets/402aa8ab-fcc6-41d7-ac69-23796309c6da)




# Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
label your changes in the changelog. Please note that maintainers freely
reserve the right to remove and add tags should they deem it
appropriate. You can attempt to finagle the system all you want, but
it's best to shoot for clear communication right off the bat. -->
<!-- If you add a name after the ':cl', that name will be used in the
changelog. You must add your CKEY after the CL if your GitHub name
doesn't match. Maintainers freely reserve the right to remove and add
tags should they deem it appropriate. -->

:cl:
fix: возможность говорить на РОДНОМ
/:cl:

<!-- Both :cl:'s are required for the changelog to work! -->
Copy link

sourcery-ai bot commented Jan 9, 2025

Reviewer's Guide by Sourcery

This pull request implements a text-to-speech (TTS) system and ports the existing system to use kilometer units. The TTS settings, including token, URL, and enable/disable status, are configurable within the text_to_speech/code/configuration.dm file.

Sequence diagram for TTS request flow

sequenceDiagram
    participant C as Client
    participant S as SStts220
    participant H as SShttp
    participant T as TTS Service

    C->>S: Request TTS
    activate S
    S->>S: Sanitize Input
    S->>S: Check Cache
    alt Cache Hit
        S->>C: Play Cached Audio
    else Cache Miss
        S->>H: Queue HTTP Request
        activate H
        H->>T: Make API Request
        T-->>H: Return Audio Data
        H-->>S: Return Response
        S->>S: Cache Audio
        S->>C: Play Audio
        deactivate H
    end
    deactivate S
Loading

Class diagram for TTS components

classDiagram
    class SStts220 {
        +is_enabled: bool
        +tts_seeds: list
        +tts_providers: list
        +tts_queue: list
        +get_tts()
        +queue_request()
        +play_tts()
        +sanitize_tts_input()
    }

    class TTSComponent {
        +tts_seed: datum
        +traits: list
        +cast_tts()
        +select_tts_seed()
        +tts_seed_change()
    }

    class TTSSeed {
        +name: string
        +value: string
        +category: string
        +gender: string
        +provider: datum
    }

    class TTSProvider {
        +name: string
        +is_enabled: bool
        +request()
        +process_response()
    }

    SStts220 --> TTSSeed
    SStts220 --> TTSProvider
    TTSComponent --> TTSSeed
Loading

File-Level Changes

Change Details Files
Implemented a TTS system.
  • Added new procs and defines related to text-to-speech in the rust_g module.
  • Added preference options for TTS.
  • Added TTS seed saving/loading in preferences.
  • Added new sound channels and volume defines for TTS.
  • Added TTS subsystem.
  • Added volume preferences for TTS.
  • Added TTS seeds.
  • Added UI for TTS seed selection.
  • Implemented TTS subsystem logic.
  • Implemented TTS component for mobs/objects.
  • Added new spans for TTS.
  • Added functions for converting numbers to words.
  • Added singletons repository.
  • Implemented SShttp for handling HTTP requests.
  • Added TTS components for various mobs.
  • Added sound effect application and local sound playing for TTS.
  • Added defines for TTS traits, categories, and phrases.
  • Implemented TTS UI explorer.
  • Added TTS components for pets.
  • Added modpack subsystem.
  • Added TTS components for lavaland mobs.
  • Added configuration options for TTS.
  • Implemented TTS provider base.
  • Added TTS component functionality to atoms.
  • Added rust utils for file operations and text processing.
  • Added TTS preferences.
  • Added TTS components for spiders.
  • Integrated TTS into hear_say and hear_radio procs.
  • Added TTS components for objects.
  • Added example modpack.
  • Added TTS components for guardians.
  • Added base TTS components for mobs.
  • Added signals for TTS component interaction.
  • Added singletons base.
  • Added base TTS seed definition.
  • Added VV support for TTS.
  • Added utility defines.
  • Added TTS seed variable to mobs.
  • Added defines220 modpack.
  • Added helpers220 modpack.
  • Added rust_utils modpack.
  • Added signals220 modpack.
  • Added singletons modpack.
  • Added tts modpack.
  • Added keybindings defines.
  • Added example wall.
  • Added signals for AI mobs.
  • Added signals for carbon mobs.
  • Added signals for living mobs.
  • Added signals for all mobs.
  • Added signals for silicon mobs.
  • Added signals for simple animals.
  • Added signals for AI mobs.
  • Added signals for carbon mobs.
  • Added signals for living mobs.
  • Added signals for all mobs.
  • Added signals for silicon mobs.
  • Added signals for simple animals.
  • Added subsystem defines.
  • Added modpack base.
  • Added TTS components for aliens.
  • Added misc defines.
  • Added TTS announcement functionality.
  • Added TTS surgery functionality.
  • Removed old TTS defines.
code/__DEFINES/__rust_g.dm
code/modules/client/preferences.dm
code/modules/client/preferences_savefile.dm
code/__DEFINES/sounds.dm
code/__DEFINES/subsystems.dm
code/modules/client/client_defines.dm
modular/text_to_speech/code/seeds/silero.dm
tgui/packages/tgui/interfaces/TTSSeedsExplorer.tsx
modular/text_to_speech/code/tts_subsystem.dm
modular/text_to_speech/code/tts_component.dm
modular/_defines220/code/defines/spans.dm
modular/text_to_speech/code/numbers.dm
modular/_singletons/code/repository.dm
modular/text_to_speech/code/SShttp.dm
modular/text_to_speech/code/base_seeds/mobs/other.dm
modular/text_to_speech/code/sound.dm
modular/text_to_speech/code/_defines.dm
modular/text_to_speech/code/tts_ui_explorer.dm
modular/text_to_speech/code/base_seeds/mobs/pets.dm
modular/_modpacks.dm
modular/text_to_speech/code/base_seeds/mobs/lavaland.dm
modular/text_to_speech/code/configuration.dm
modular/text_to_speech/code/tts_provider.dm
modular/text_to_speech/code/tts_atom.dm
modular/_rust_utils/code/rust_utils.dm
modular/text_to_speech/code/tts_preferences.dm
modular/text_to_speech/code/base_seeds/mobs/spider.dm
modular/text_to_speech/code/hear.dm
modular/text_to_speech/code/base_seeds/objs/objs.dm
modular/example/_example.dm
modular/text_to_speech/code/base_seeds/mobs/guardian.dm
modular/text_to_speech/code/base_seeds/mobs/_base.dm
modular/_defines220/code/signals_atom.dm
modular/_singletons/code/singletons.dm
modular/text_to_speech/code/seeds/base.dm
modular/text_to_speech/code/tts_vv.dm
modular/_defines220/code/defines/misc.dm
modular/text_to_speech/code/tts_seed.dm
modular/_defines220/_defines220.dm
modular/_helpers220/_helpers220.dm
modular/_rust_utils/_rust_utils.dm
modular/_signals220/_signals220.dm
modular/_singletons/_singletons.dm
modular/text_to_speech/_tts.dm
modular/_defines220/code/defines/keybindings.dm
modular/example/code/example.dm
modular/_defines220/code/signals_mob/signals_mob_ai.dm
modular/_defines220/code/signals_mob/signals_mob_carbon.dm
modular/_defines220/code/signals_mob/signals_mob_living.dm
modular/_defines220/code/signals_mob/signals_mob_main.dm
modular/_defines220/code/signals_mob/signals_mob_silicon.dm
modular/_defines220/code/signals_mob/signals_mob_simple.dm
modular/_signals220/code/signals_mob/signals_mob_ai.dm
modular/_signals220/code/signals_mob/signals_mob_carbon.dm
modular/_signals220/code/signals_mob/signals_mob_living.dm
modular/_signals220/code/signals_mob/signals_mob_main.dm
modular/_signals220/code/signals_mob/signals_mob_silicon.dm
modular/_signals220/code/signals_mob/signals_mob_simple.dm
modular/_defines220/code/defines/subsystems.dm
modular/_modpack.dm
modular/text_to_speech/code/base_seeds/mobs/alien.dm
modular/_defines220/code/defines/misc.dm
modular/text_to_speech/code/tts_announce.dm
modular/text_to_speech/code/tts_surgery.dm
modular/text_to_speech/code/~undefs/~undefs.dm
Ported existing systems to kilometer units.
  • Changed some numerical values.
code/__DEFINES/__rust_g.dm
Fixed RU language related bugs.
  • Replaced copytext() with copytext_char() for handling RU characters.
  • Replaced replacetext() with replacetext_char() for handling RU characters.
  • Added Cyrillic characters to uppercase/lowercase checks.
  • Changed character set to UTF-8.
  • Fixed potential issues with RU characters in say procs.
code/modules/mob/living/carbon/human/say.dm
code/modules/mob/living/carbon/xenomorph/say.dm
code/__HELPERS/text.dm
code/datums/browser.dm
code/modules/mob/living/silicon/say.dm
code/modules/mob/living/simple_animal/parrot.dm
code/modules/mob/living/silicon/decoy/decoy.dm
code/modules/mob/say.dm
code/game/machinery/status_display.dm
code/modules/mob/living/simple_animal/simple_animal.dm
code/modules/mob/mob_helpers.dm
code/modules/nano/nanoui.dm
code/modules/flufftext/TextFilters.dm
code/modules/maptext_alerts/text_blurbs.dm
code/modules/mob/living/carbon/human/human_abilities.dm
code/modules/mob/living/carbon/human/whisper.dm
Updated dependencies and configurations.
  • Added permissions to conflicts workflow.
  • Added modular code check to CI suite.
  • Added modular directory to build process.
  • Updated Discord link in README.
  • Changed preload RSC to 0.
  • Added callback datum to http_request.
.github/workflows/conflicts.yml
.github/workflows/ci_suite.yml
tools/build/build.js
README.md
_compile_options.dm
code/datums/http.dm

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@dj-34
Copy link

dj-34 commented Jan 10, 2025

скримеры в видео

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