3

I would like to add my language to Ubuntu, especially at least to spd-say, to make it possible make system speak out messages in my own language.

I checked spd-say to see if my language is their or not, using the following code. But my language is not listed.

spd-say -L

Who can help me? I would like to find someone to help me add my language to spd-say.

Can anyone help To solve my problem?

1 Answer 1

1

In Brief

By "my language", I assume you mean Farsi. It is already supported. You, however, need to specify the Farsi language code with -l "fa" and use it like so:

spd-say -l "fa" "درود و رحمت و برکات خداوند. این متن به زبان فارسی نوشته شده است."

Not all the included synthetic voices support it though, but the default one does.

Persian (Pinglish) is the only available other voice synthesis of interest to you and can be specified with -l "fa-LATN"

In Detail

spd-say, which is provided by the speech-dispatcher meta package, is a front-end / client for speech-dispatcher i.e. the text-to-speech processing and synthesis including language support happens at the speech-dispatcher end not spd-say. speech-dispatcher on Ubuntu comes with around 8611 possible languages / variants / synthetic voices that are installed by default. Language support, however, depends on the Speech Dispatcher's project maintainers / developers and is not directly related to Ubuntu. Thus, if you are interested in the development of Speech Dispatcher itself (e.g. requesting / adding a new language) the right place to start is the Speech Dispatcher project page.

However, spd-say -L might not be enough to list the supported languages through spd-say. In order to do that, you need to specify the output module as well like so:

spd-say -o espeak-ng -L

The available output modules list can be retrieved like so:

spd-say -O

On the other hand, various aspects like the list of supported languages / scripts by speech-dispatcher (output below was reduced to your language of interest but the list is very long) can be queried as well through Python like so:

$ 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'))
>>> 

Another speech synthesis project that you might be interested in as well is the Festival project, which is available for install on Ubuntu like so:

sudo apt install festival

Here is an example of Festival usage on Ubuntu.

6
  • actually not Persian (Farsi), but Persian (Ironik).. it is a writing method to transcribe Iranian languages (including Persian) using Latin alphabet. and of course not to be confused to Pingilish or Fargilisi which are non documented ways to write Farsi (their goal was to some how write the proper names for western people) Commented May 6, 2022 at 13:04
  • and lets not limiting it to well-known languages... say one wants to add their conlang (artificial language) to the list... what should they do? Commented May 6, 2022 at 13:14
  • 1
    @OmidGhayour I checked and, unfortunately, Persian (Ironik) is not supported. "How to develop or add a new language / script to Speech Dispatcher?" is off-topic on Ask Ubuntu. I, however, updated the answer with enough information to help get you headed in the right direction. :)
    – Raffa
    Commented May 6, 2022 at 15:49
  • @Raffa Is there any work around to let spd-say read from a file instead of some text driectly from stdin?
    – Farzan
    Commented Jan 23, 2023 at 23:44
  • @Farzan Yes, through a pipe with the -e option ... e.g. cat file | spd-say -e ... You might also need the --wait option
    – Raffa
    Commented Jan 24, 2023 at 7:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .