Enabling Puppy to speak in multiple languages:
This post details a possible approach to adding spoken translated text to puppy system scripts
that contain gettext splash messages of various types.
I would envisage it being used just for important informational messages or warnings.
I posted here: http://murga-linux.com/puppy/viewtopic. ... 37#1017537
about a "Multilingual Spoken Startup Welcome Plus Internet Alarm" pet and once again google translate is
used here but this time in conjunction with global environment variables set by the file /etc/profile.d/tts
A small standard block of code needs to be added to any script where display & speech is required.
The proof of concept demo pet (speechify-V2.pet) attached in the second post here, includes a modified system script ( /usr/sbin/save2flash )
The modified lines in that are as follows with the added code in colour.
- yaf-splash -bg orange -placement top -close never -text "$(gettext "Saving RAM to 'pup_save'...")" &
YAFPID=$!
trans -b -p $TTS_FROM: :$TTS_TO "Saving RAM to 'pup-save'..."
Should music already be playing the spoken message is mixed in with it and is easily audible.
Installation:
1. I would recommend first installing the pet referenced in the link above as the speechify.pet in this thread also requires translate-shell_0.9.6.6-1 plus it's dependencies.
The 2 pets in combination also give a better impression of what this could lead to.
2. In "Default Applications Chooser" make sure that you have /usr/bin/mpv set as the default "Audio Player"
3. Install the speechify.pet and reboot ensuring that you save the session.
Testing and Testers:
This demo pet has only been tested with 666philb's Bionicpup64 8.0 CE but should work with any recent WoofCE Pup that has translate-shell in it's repositories.
In particular I would appreciate testing by members who normally operate in a language other than English. (en)
Provision is made in the /etc/profile.d/tts file for bilingual members such as musher0 who may be operating in either language to display messages
in one language but have them spoken in another language. (musher0 for example, may prefer them spoken in his native Latin !)
Please let me know if you can suggest other possible scripts that could benefit from having speech added and I will endeavour to do that and add them to the speechify.pet.
Finally:
A copy of the /etc/profile.d/tts file included in the pet is reproduced below.
Code: Select all
# This is /etc/profile.d/tts ETP 9th March 2019
# Sets global environment variables for text to speech in addition to gettext message.
# NOTES:
# GETTEXT messages are currently in english but in addition to being displayed in your own language
# will also be spoken in your own language. Minor changes will need to be made to any scripts that can make effective use of this speech utility.
#
# Provision is also made to have the spoken language set to a language other than the displayed language.
# Assuming that you selected English when first setting up the Pup everything would be in English but by
# commenting out line 15 and uncommenting line 16 you can opt to specify, at the end of line 16, any other language
# just for the spoken messages. If you make any changes to this file you must save and reboot to give effect to those changes.
#
#
# Line 13
export TTS_FROM=en
export TTS_TO=`echo $LANG | cut -d_ -f1`
# export TTS_TO=fr