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 is Not Enabled Error when text-to-speech feature test #12059

Closed
5 tasks done
kevintsai1202 opened this issue Dec 25, 2024 · 5 comments
Closed
5 tasks done

TTS is Not Enabled Error when text-to-speech feature test #12059

kevintsai1202 opened this issue Dec 25, 2024 · 5 comments
Labels
🐞 bug Something isn't working tts issues related to audio and tts

Comments

@kevintsai1202
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.14.2

Cloud or Self Hosted

Cloud

Steps to reproduce

When I configure the text-to-speech feature and press play, the message "TTS is not enabled" appears. However, I have already set the OpenAI TTS model in the configuration.

圖片

圖片

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

@dosubot dosubot bot added tts issues related to audio and tts 🐞 bug Something isn't working labels Dec 25, 2024
Copy link

dosubot bot commented Dec 25, 2024

I found a similar issue that might help you resolve the "TTS is not enabled" error. The error typically indicates that the Text-to-Speech (TTS) feature is not activated in your application's configuration. To resolve this, ensure that the TTS feature is enabled in your configuration file. Here's a general approach:

  1. Check your application's configuration file and look for the text_to_speech section.

  2. Ensure that the enabled key is set to True. Your configuration should look something like this:

    config = {
        "text_to_speech": {
            "enabled": True,
            "voice": "default_voice",  # Optional: specify the voice
            "language": "en"           # Optional: specify the language
        }
    }

Additionally, if you are using OpenAI TTS, make sure that FFmpeg is installed on your system, as it is required for the TTS functionality to work properly [1][2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@kevintsai1202
Copy link
Author

@dosu This can only be used during an HTTP call. The current issue lies in the configuration.

I found a similar issue that might help you resolve the "TTS is not enabled" error. The error typically indicates that the Text-to-Speech (TTS) feature is not activated in your application's configuration. To resolve this, ensure that the TTS feature is enabled in your configuration file. Here's a general approach:我發現了一個類似的問題,可能有助於你解決「TTS 未啟用」錯誤。這個錯誤通常表示你的應用程式配置中未啟用文字轉語音(TTS)功能。要解決這個問題,請確保在你的配置檔案中啟用 TTS 功能。以下是一般的做法:

1. Check your application's configuration file and look for the `text_to_speech` section.檢查您的應用程式的配置檔案,並尋找 `text_to_speech` 區段。

2. Ensure that the `enabled` key is set to `True`. Your configuration should look something like this:確保 `enabled` 鍵被設置為 `True` 。您的配置應該看起來像這樣:
   ```python
   config = {
       "text_to_speech": {
           "enabled": True,
           "voice": "default_voice",  # Optional: specify the voice
           "language": "en"           # Optional: specify the language
       }
   }
   ```

Additionally, if you are using OpenAI TTS, make sure that FFmpeg is installed on your system, as it is required for the TTS functionality to work properly [1][2].此外,如果您正在使用 OpenAI TTS,請確保您的系統上已安裝 FFmpeg ,因為這是 TTS 功能正常運作所需的 [1] [2]

To continue talking to Dosu, mention @dosu.要繼續與 Dosu 對話,請提及。

Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Copy link

dosubot bot commented Dec 25, 2024

To resolve the "TTS is not enabled" error during an HTTP call, ensure that the Text-to-Speech (TTS) feature is enabled in your application's configuration. Specifically, check the following:

  1. If your application is in ADVANCED_CHAT or WORKFLOW mode, make sure the workflow object is not None and that features_dict contains the key "text_to_speech" with "enabled" set to True.

  2. If your application is not in these modes, verify that the text_to_speech_dict in app_model.app_model_config has "enabled" set to True [1][2].

Additionally, ensure that your configuration dictionary is correctly structured, with the text_to_speech key as a dictionary containing the enabled field set to a boolean value. If the configuration is missing or incorrectly formatted, the validate_and_set_defaults method will set defaults that may disable TTS [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@crazywoola
Copy link
Member

crazywoola commented Dec 25, 2024

You need to publish to make this work.

if app_model.mode in {AppMode.ADVANCED_CHAT.value, AppMode.WORKFLOW.value}:
workflow = app_model.workflow
if workflow is None:
raise ValueError("TTS is not enabled")
features_dict = workflow.features_dict
if "text_to_speech" not in features_dict or not features_dict["text_to_speech"].get("enabled"):
raise ValueError("TTS is not enabled")
voice = features_dict["text_to_speech"].get("voice") if voice is None else voice
else:
text_to_speech_dict = app_model.app_model_config.text_to_speech_dict
if not text_to_speech_dict.get("enabled"):
raise ValueError("TTS is not enabled")

@kevintsai1202
Copy link
Author

You need to publish to make this work.

if app_model.mode in {AppMode.ADVANCED_CHAT.value, AppMode.WORKFLOW.value}:
workflow = app_model.workflow
if workflow is None:
raise ValueError("TTS is not enabled")
features_dict = workflow.features_dict
if "text_to_speech" not in features_dict or not features_dict["text_to_speech"].get("enabled"):
raise ValueError("TTS is not enabled")
voice = features_dict["text_to_speech"].get("voice") if voice is None else voice
else:
text_to_speech_dict = app_model.app_model_config.text_to_speech_dict
if not text_to_speech_dict.get("enabled"):
raise ValueError("TTS is not enabled")

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working tts issues related to audio and tts
Projects
None yet
Development

No branches or pull requests

2 participants