Compare commits

..

2 Commits

2 changed files with 11 additions and 3 deletions

View File

@ -29,8 +29,10 @@ This script has some settings. Use the /set command to set them. To see the enti
Here are the settings. Here are the settings.
- speech_voice <voice> - espd-say voice to use (default is en-us) - speech_voice <voice> - espd-say voice to use (default is en-us)
- speech_rate <digits> - speech rate(-100 to 100) (default is 50) - speech_rate <digits> - speech rate(-100 to 100) (default is 0)
- speech_volume <digits> - speech volume (-100 to 100) (default is 0)
- speech_module <module> - Speech dispatcher output module to use (Default is espeak-ng) - speech_module <module> - Speech dispatcher output module to use (Default is espeak-ng)
- speech_priority <priority> - Sets the speech priority according to speech-dispatcher's priority system (default is text)
- speak_public_messages <on/off> - Speak public messages; This does not speak all messages by default. [See the next setting.] This only speaks when you are directly spoken to. (Default is on) - speak_public_messages <on/off> - Speak public messages; This does not speak all messages by default. [See the next setting.] This only speaks when you are directly spoken to. (Default is on)
- speak_all_public_message <on/off> - Speak every single message reguardless of if you are mensioned or not. (Default is off) - speak_all_public_message <on/off> - Speak every single message reguardless of if you are mensioned or not. (Default is off)
- speak_indirect_messages - Speaks indirect messages in public channels, reguardless of where your nick sits in the message; If this if off, public messages will only pseak if directly addressed to you. (Default is off) - speak_indirect_messages - Speaks indirect messages in public channels, reguardless of where your nick sits in the message; If this if off, public messages will only pseak if directly addressed to you. (Default is off)

View File

@ -43,18 +43,22 @@ sub speak_message {
$summary = decode(ENCODING, $summary); $summary = decode(ENCODING, $summary);
$body = decode(ENCODING, $body); $body = decode(ENCODING, $body);
my $SpeechRate = Irssi::settings_get_int("speech_rate"); my $SpeechRate = Irssi::settings_get_int("speech_rate");
my $SpeechVolume = Irssi::settings_get_int("speech_volume");
my $SpeechVoice = Irssi::settings_get_str("speech_voice"); my $SpeechVoice = Irssi::settings_get_str("speech_voice");
my $SpeechModule = Irssi::settings_get_str("speech_module"); my $SpeechModule = Irssi::settings_get_str("speech_module");
my $SpeechPriority = Irssi::settings_get_str("speech_priority");
# Speak The Message # Speak The Message
my @spd = ("spd-say", my @spd = ("spd-say",
"-P", "-P",
"message", $SpeechPriority,
"-o", "-o",
$SpeechModule, $SpeechModule,
"-y", "-y",
$SpeechVoice, $SpeechVoice,
"-r", "-r",
$SpeechRate, $SpeechRate,
"-i",
$SpeechVolume,
"$summary $body"); "$summary $body");
system(@spd); system(@spd);
} }
@ -200,9 +204,11 @@ sub dcc_chat_message {
} }
# Register configuration options: # Register configuration options:
Irssi::settings_add_int("autospeak", "speech_rate", 50); Irssi::settings_add_int("autospeak", "speech_rate", 0);
Irssi::settings_add_int("autospeak", "speech_volume", 0);
Irssi::settings_add_str("autospeak", "speech_voice", "en-us"); Irssi::settings_add_str("autospeak", "speech_voice", "en-us");
Irssi::settings_add_str("autospeak", "speech_module", "espeak-ng"); Irssi::settings_add_str("autospeak", "speech_module", "espeak-ng");
Irssi::settings_add_str("autospeak", "speech_priority", "text");
Irssi::settings_add_bool('autospeak', 'speak_private_messages', 1); Irssi::settings_add_bool('autospeak', 'speak_private_messages', 1);
Irssi::settings_add_bool('autospeak', 'speak_public_messages', 1); Irssi::settings_add_bool('autospeak', 'speak_public_messages', 1);
Irssi::settings_add_bool('autospeak', 'speak_all_public_messages', 0); Irssi::settings_add_bool('autospeak', 'speak_all_public_messages', 0);