You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Talkey无法切换eSpeak语音求助:葡萄牙语女声配置无效

Troubleshooting Talkey + eSpeak Portuguese Female Voice Issue

Let me walk you through fixing this—I’ve run into similar Talkey configuration hiccups before!

First, let’s break down the potential issues and solutions step by step:

1. Verify MBROLA Voice Files Are Installed

The brazil-mbrola-4 voice depends on the MBROLA engine and its corresponding voice package, which most systems don’t install by default. Let’s rule this out first:

  • Test if eSpeak can use the voice directly from the command line:
    espeak -v brazil-mbrola-4 "Olá, esta é uma voz feminina de teste"
    
  • If you get an error like Cannot find voice 'brazil-mbrola-4' or no sound, install the required packages:
    • For Debian/Ubuntu-based systems:
      sudo apt-get install mbrola mbrola-br4
      
    • For other systems, download the mb-br4 voice file from the MBROLA repository and place it in /usr/share/mbrola/ (or ~/.mbrola/ for user-specific installs).

2. Fix Talkey’s Language Code Mapping

Talkey expects language keys that match eSpeak’s precise language codes. Your original config uses pt (generic Portuguese), but the brazil-mbrola-4 voice is tied to pt-br (Brazilian Portuguese). Let’s adjust that:

tts = talkey.Talkey(
    preferred_languages=['pt-br'],  # Use precise regional code
    engine_preference=['espeak'],
    espeak={
        'options':{
            'enabled': True,
        },
        'languages':{
            'pt-br': {  # Match the preferred language code
                'voice': 'brazil-mbrola-4'
            },
        }
    }
)

3. Add Extra Arguments to Force Voice Selection

If the above still doesn’t work, Talkey’s internal voice mapping might be misfiring. Add direct eSpeak arguments to enforce the voice:

tts = talkey.Talkey(
    preferred_languages=['pt-br'],
    engine_preference=['espeak'],
    espeak={
        'options':{
            'enabled': True,
        },
        'languages':{
            'pt-br': {
                'voice': 'brazil-mbrola-4',
                'extra_args': ['-v', 'brazil-mbrola-4']  # Force eSpeak to use this voice
            },
        }
    }
)

Final Check

After installing the MBROLA packages and adjusting the config, test with a simple line to confirm:

tts.say("Olá! Agora a voz deve ser feminina brasileira.")

内容的提问来源于stack exchange,提问作者Giovana Morais

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:07:23