我想将我的语言添加到 Ubuntu,特别是至少添加到 spd-say,以便系统能够用我自己的语言说出消息。
我使用以下代码检查了 spd-say,看看我的语言是否是他们的。但我的语言没有列出。
spd-say -L
谁能帮助我?我想找人帮我将我的语言添加到 spd-say。
有人能帮忙解决我的问题吗?
答案1
简单来说
经过“我的语言”,我想你的意思是波斯语。它已受支持。但是,您需要指定波斯语语言代码并-l "fa"
像这样使用它:
spd-say -l "fa" "درود و رحمت و برکات خداوند. این متن به زبان فارسی نوشته شده است."
虽然并非所有包含的合成声音都支持它,但默认合成声音支持它。
波斯语(平式英语)是唯一可用的其他语音合成,你感兴趣,可以指定-l "fa-LATN"
详细
spd-say
,由 Speech-dispatcher 元包提供,是前端/客户端为了语音调度器即文本到语音的处理和合成(包括语言支持)发生在最后,speech-dispatcher
而不是spd-say
。Ubuntuspeech-dispatcher
上默认安装了大约 8611 种可能的语言/变体/合成声音。但是,语言支持取决于 Speech Dispatcher 的项目维护者/开发人员,与 Ubuntu 没有直接关系。因此,如果您对 Speech Dispatcher 本身的开发感兴趣(例如请求/添加新语言)正确的起点是语音调度器项目页面。
然而,spd-say -L
可能不足以通过列出支持的语言spd-say
。为了做到这一点,您还需要指定输出模块,如下所示:
spd-say -o espeak-ng -L
可以像这样检索可用的输出模块列表:
spd-say -O
另一方面,支持语言/文字列表等各个方面speech-dispatcher
(下面的输出已缩减为您感兴趣的语言,但列表很长)也可以通过 Python 进行查询,如下所示:
$ python3
Python 3.10.4 (main, Apr 2 2022, 09:04:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import speechd
>>> spk = speechd.Speaker('me')
>>> spk.list_output_modules()
('espeak-ng-mbrola', 'espeak-ng')
>>> spk.set_output_module('espeak-ng')
>>> spk.list_synthesis_voices()
(('Persian', 'fa', 'none'), ('Persian+Andrea', 'fa', 'Andrea'), ('Persian+Annie', 'fa', 'Annie'), ('Persian+Antonio', 'fa', 'Antonio'), ('Persian+Auntie', 'fa', 'Auntie'), ('Persian+Belinda', 'fa', 'Belinda'), ('Persian+Boris', 'fa', 'Boris'), ('Persian+Denis', 'fa', 'Denis'), ('Persian+Diogo', 'fa', 'Diogo'), ('Persian+Ed', 'fa', 'Ed'), ('Persian+Gene', 'fa', 'Gene'), ('Persian+Gene2', 'fa', 'Gene2'), ('Persian+Henrique', 'fa', 'Henrique'), ('Persian+Hugo', 'fa', 'Hugo'), ('Persian+Iven', 'fa', 'Iven'), ('Persian+Iven2', 'fa', 'Iven2'), ('Persian+Iven3', 'fa', 'Iven3'), ('Persian+Jacky', 'fa', 'Jacky'), ('Persian+John', 'fa', 'John'), ('Persian+Kaukovalta', 'fa', 'Kaukovalta'), ('Persian+Mario', 'fa', 'Mario'), ('Persian+Max', 'fa', 'Max'), ('Persian+Michael', 'fa', 'Michael'), ('Persian+Michel', 'fa', 'Michel'), ('Persian+Miguel', 'fa', 'Miguel'), ('Persian+Mr_Serious', 'fa', 'Mr_Serious'), ('Persian+Nguyen', 'fa', 'Nguyen'), ('Persian+Pablo', 'fa', 'Pablo'), ('Persian+Pablo2', 'fa', 'Pablo2'), ('Persian+Paul', 'fa', 'Paul'), ('Persian+Pedro', 'fa', 'Pedro'), ('Persian+Quincy', 'fa', 'Quincy'), ('Persian+RicishayMax', 'fa', 'RicishayMax'), ('Persian+RicishayMax2', 'fa', 'RicishayMax2'), ('Persian+RicishayMax3', 'fa', 'RicishayMax3'), ('Persian+Rob', 'fa', 'Rob'), ('Persian+Robert', 'fa', 'Robert'), ('Persian+Robosoft3', 'fa', 'Robosoft3'), ('Persian+Robosoft4', 'fa', 'Robosoft4'), ('Persian+Robosoft5', 'fa', 'Robosoft5'), ('Persian+Robosoft6', 'fa', 'Robosoft6'), ('Persian+Robosoft7', 'fa', 'Robosoft7'), ('Persian+Robosoft8', 'fa', 'Robosoft8'), ('Persian+Steph', 'fa', 'Steph'), ('Persian+Steph2', 'fa', 'Steph2'), ('Persian+Steph3', 'fa', 'Steph3'), ('Persian+Storm', 'fa', 'Storm'), ('Persian+Tweaky', 'fa', 'Tweaky'), ('Persian+Zac', 'fa', 'Zac'), ('Persian+anika', 'fa', 'anika'), ('Persian+anikaRobot', 'fa', 'anikaRobot'), ('Persian+fast_test', 'fa', 'fast_test'), ('Persian+female2', 'fa', 'female2'), ('Persian+female3', 'fa', 'female3'), ('Persian+female4', 'fa', 'female4'), ('Persian+female5', 'fa', 'female5'), ('Persian+female_whisper', 'fa', 'female_whisper'), ('Persian+grandpa', 'fa', 'grandpa'), ('Persian+klatt', 'fa', 'klatt'), ('Persian+klatt2', 'fa', 'klatt2'), ('Persian+klatt3', 'fa', 'klatt3'), ('Persian+klatt4', 'fa', 'klatt4'), ('Persian+male2', 'fa', 'male2'), ('Persian+male3', 'fa', 'male3'), ('Persian+male4', 'fa', 'male4'), ('Persian+male5', 'fa', 'male5'), ('Persian+male6', 'fa', 'male6'), ('Persian+male7', 'fa', 'male7'), ('Persian+norbert', 'fa', 'norbert'), ('Persian+sandro', 'fa', 'sandro'), ('Persian+shelby', 'fa', 'shelby'), ('Persian+travis', 'fa', 'travis'), ('Persian+victor', 'fa', 'victor'), ('Persian+whisper', 'fa', 'whisper'), ('Persian+male8', 'fa', 'male8'), ('Persian+female1', 'fa', 'female1'), ('Persian+croak', 'fa', 'croak'), ('Persian+male1', 'fa', 'male1'), ('Persian+grandma', 'fa', 'grandma'), ('Persian (Pinglish)', 'fa-LATN', 'none'), ('Persian (Pinglish)+Andrea', 'fa-LATN', 'Andrea'), ('Persian (Pinglish)+Annie', 'fa-LATN', 'Annie'), ('Persian (Pinglish)+Antonio', 'fa-LATN', 'Antonio'), ('Persian (Pinglish)+Auntie', 'fa-LATN', 'Auntie'), ('Persian (Pinglish)+Belinda', 'fa-LATN', 'Belinda'), ('Persian (Pinglish)+Boris', 'fa-LATN', 'Boris'), ('Persian (Pinglish)+Denis', 'fa-LATN', 'Denis'), ('Persian (Pinglish)+Diogo', 'fa-LATN', 'Diogo'), ('Persian (Pinglish)+Ed', 'fa-LATN', 'Ed'), ('Persian (Pinglish)+Gene', 'fa-LATN', 'Gene'), ('Persian (Pinglish)+Gene2', 'fa-LATN', 'Gene2'), ('Persian (Pinglish)+Henrique', 'fa-LATN', 'Henrique'), ('Persian (Pinglish)+Hugo', 'fa-LATN', 'Hugo'), ('Persian (Pinglish)+Iven', 'fa-LATN', 'Iven'), ('Persian (Pinglish)+Iven2', 'fa-LATN', 'Iven2'), ('Persian (Pinglish)+Iven3', 'fa-LATN', 'Iven3'), ('Persian (Pinglish)+Jacky', 'fa-LATN', 'Jacky'), ('Persian (Pinglish)+John', 'fa-LATN', 'John'), ('Persian (Pinglish)+Kaukovalta', 'fa-LATN', 'Kaukovalta'), ('Persian (Pinglish)+Mario', 'fa-LATN', 'Mario'), ('Persian (Pinglish)+Max', 'fa-LATN', 'Max'), ('Persian (Pinglish)+Michael', 'fa-LATN', 'Michael'), ('Persian (Pinglish)+Michel', 'fa-LATN', 'Michel'), ('Persian (Pinglish)+Miguel', 'fa-LATN', 'Miguel'), ('Persian (Pinglish)+Mr_Serious', 'fa-LATN', 'Mr_Serious'), ('Persian (Pinglish)+Nguyen', 'fa-LATN', 'Nguyen'), ('Persian (Pinglish)+Pablo', 'fa-LATN', 'Pablo'), ('Persian (Pinglish)+Pablo2', 'fa-LATN', 'Pablo2'), ('Persian (Pinglish)+Paul', 'fa-LATN', 'Paul'), ('Persian (Pinglish)+Pedro', 'fa-LATN', 'Pedro'), ('Persian (Pinglish)+Quincy', 'fa-LATN', 'Quincy'), ('Persian (Pinglish)+RicishayMax', 'fa-LATN', 'RicishayMax'), ('Persian (Pinglish)+RicishayMax2', 'fa-LATN', 'RicishayMax2'), ('Persian (Pinglish)+RicishayMax3', 'fa-LATN', 'RicishayMax3'), ('Persian (Pinglish)+Rob', 'fa-LATN', 'Rob'), ('Persian (Pinglish)+Robert', 'fa-LATN', 'Robert'), ('Persian (Pinglish)+Robosoft3', 'fa-LATN', 'Robosoft3'), ('Persian (Pinglish)+Robosoft4', 'fa-LATN', 'Robosoft4'), ('Persian (Pinglish)+Robosoft5', 'fa-LATN', 'Robosoft5'), ('Persian (Pinglish)+Robosoft6', 'fa-LATN', 'Robosoft6'), ('Persian (Pinglish)+Robosoft7', 'fa-LATN', 'Robosoft7'), ('Persian (Pinglish)+Robosoft8', 'fa-LATN', 'Robosoft8'), ('Persian (Pinglish)+Steph', 'fa-LATN', 'Steph'), ('Persian (Pinglish)+Steph2', 'fa-LATN', 'Steph2'), ('Persian (Pinglish)+Steph3', 'fa-LATN', 'Steph3'), ('Persian (Pinglish)+Storm', 'fa-LATN', 'Storm'), ('Persian (Pinglish)+Tweaky', 'fa-LATN', 'Tweaky'), ('Persian (Pinglish)+Zac', 'fa-LATN', 'Zac'), ('Persian (Pinglish)+anika', 'fa-LATN', 'anika'), ('Persian (Pinglish)+anikaRobot', 'fa-LATN', 'anikaRobot'), ('Persian (Pinglish)+fast_test', 'fa-LATN', 'fast_test'), ('Persian (Pinglish)+female2', 'fa-LATN', 'female2'), ('Persian (Pinglish)+female3', 'fa-LATN', 'female3'), ('Persian (Pinglish)+female4', 'fa-LATN', 'female4'), ('Persian (Pinglish)+female5', 'fa-LATN', 'female5'), ('Persian (Pinglish)+female_whisper', 'fa-LATN', 'female_whisper'), ('Persian (Pinglish)+grandpa', 'fa-LATN', 'grandpa'), ('Persian (Pinglish)+klatt', 'fa-LATN', 'klatt'), ('Persian (Pinglish)+klatt2', 'fa-LATN', 'klatt2'), ('Persian (Pinglish)+klatt3', 'fa-LATN', 'klatt3'), ('Persian (Pinglish)+klatt4', 'fa-LATN', 'klatt4'), ('Persian (Pinglish)+male2', 'fa-LATN', 'male2'), ('Persian (Pinglish)+male3', 'fa-LATN', 'male3'), ('Persian (Pinglish)+male4', 'fa-LATN', 'male4'), ('Persian (Pinglish)+male5', 'fa-LATN', 'male5'), ('Persian (Pinglish)+male6', 'fa-LATN', 'male6'), ('Persian (Pinglish)+male7', 'fa-LATN', 'male7'), ('Persian (Pinglish)+norbert', 'fa-LATN', 'norbert'), ('Persian (Pinglish)+sandro', 'fa-LATN', 'sandro'), ('Persian (Pinglish)+shelby', 'fa-LATN', 'shelby'), ('Persian (Pinglish)+travis', 'fa-LATN', 'travis'), ('Persian (Pinglish)+victor', 'fa-LATN', 'victor'), ('Persian (Pinglish)+whisper', 'fa-LATN', 'whisper'), ('Persian (Pinglish)+male8', 'fa-LATN', 'male8'), ('Persian (Pinglish)+female1', 'fa-LATN', 'female1'), ('Persian (Pinglish)+croak', 'fa-LATN', 'croak'), ('Persian (Pinglish)+male1', 'fa-LATN', 'male1'), ('Persian (Pinglish)+grandma', 'fa-LATN', 'grandma'))
>>>
另一个语音合成项目您可能也感兴趣的是节庆项目,可以在 Ubuntu 上安装,如下所示:
sudo apt install festival
以下是一个例子Ubuntu 上的节日用法。