Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Unable to change TTS language - French language setting not propagated through the system #6

Open
ttamoud opened this issue Aug 1, 2024 · 2 comments

Comments

@ttamoud
Copy link

ttamoud commented Aug 1, 2024

Currently, there is no functional way to change the Text-to-Speech (TTS) language in our application. While the system is intended to support French ("fr") as a language option, this setting is not being properly propagated through the application stack. This issue affects the user experience as it prevents the bot from speaking in the desired language.

Detailed breakdown of the issue:

  1. Frontend Configuration:

    • In config.ts, we have a language definition for French:
      export const languages: Language[] = [
        {
          language: "French",
          model_id: "sonic-multilingual",
          code: "fr",
          voice: "a8a1eb38-5f15-4c1d-8722-7ac0f329727d",
        },
      ];
    • However, this language setting is not being used in the default configuration or in any language selection logic.
  2. Voice Selection:

    • The VoiceSelect component in the frontend only allows selection of voices, not languages.
    • There is no separate language selection component.
  3. Configuration Update:

    • When updating the TTS configuration (e.g., when changing voices), the language is not included:
      updateConfig({
        tts: { voice: voice.id },
      });
  4. Backend Configuration Handling:

    • In rtvi.py, the RTVITTSConfig class does not include a language field.
    • The _handle_setup method in the RTVIProcessor does not extract or use a language setting from the configuration.
  5. TTS Service Initialization:

    • When initializing the CartesiaTTSService in rtvi.py, no language parameter is passed:
      self._tts = self._tts_cls(
          name="TTS",
          api_key=self._tts_api_key,
          voice_id=voice,
          model_id="sonic-multilingual"
      )
  6. Cartesia API Call:

    • In cartesia.py, the run_tts method does not include a language parameter in the API call to Cartesia.

Steps to reproduce:

  1. Start the application.
  2. Attempt to change the language to French.
  3. Interact with the bot.

Expected behavior:
The bot should speak in French when the French language is selected.

Actual behavior:
The bot continues to speak in the default language, regardless of any attempt to change to French.

@ailab2017
Copy link

这个问题最终有答案了么?我也遇到了这个问题

@ttamoud
Copy link
Author

ttamoud commented Aug 30, 2024

Its fixed in the latest Pipecat version, it has a language parameter that you can change.

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

No branches or pull requests

2 participants