From 62eedff7da44a921ce6f2c0edf573092deb8820e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 29 Jun 2022 23:00:24 +0100 Subject: [PATCH 01/19] Support for mimic3 tts --- README_desktop_client.md | 14 +++++++++++++- desktop_client.py | 25 +++++++++++++++++++++++++ epicyon.py | 3 ++- install-desktop-client | 15 +++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) diff --git a/README_desktop_client.md b/README_desktop_client.md index 95e8bedd3..4b84d4d4c 100644 --- a/README_desktop_client.md +++ b/README_desktop_client.md @@ -28,6 +28,12 @@ Or if you have picospeaker installed: ~/epicyon-client-pico ``` +Or if you have mimic3 installed: + +``` bash +~/epicyon-client-mimic3 +``` + ## Commands The desktop client has a few commands, which may be more convenient than the web interface for some purposes: @@ -87,7 +93,13 @@ Or a quicker version, if you have installed the desktop client as described abov Or if you have [picospeaker](https://gitlab.com/ky1e/picospeaker) installed: ``` bash -python3 epicyon.py --notifyShowNewPosts --screenreader picospeaker --desktop yournickname@yourdomain +~/epicyon-stream-pico +``` + +Or if you have mimic3 installed: + +``` bash +~/epicyon-stream-mimic3 ``` You can also use the **--password** option to provide the password. This will then stay running and incoming posts will be announced as they arrive. diff --git a/desktop_client.py b/desktop_client.py index 40c2e80f2..3724a47e1 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -326,6 +326,29 @@ def _speaker_espeak(espeak, pitch: int, rate: int, srange: int, espeak.synth(html.unescape(say_text)) +def _speaker_mimic3(pitch: int, rate: int, srange: int, + say_text: str) -> None: + """Speaks the given text with mimic3 + """ + voice = 'en_UK/apope_low' + if pitch > 20: + voice = 'en_US/m-ailabs_low' + if pitch > 40: + voice = 'en_US/hifi-tts_low' + if pitch >= 50: + voice = 'en_US/ljspeech_low' + if pitch > 75: + voice = 'en_US/vctk_low' + length_scale = str(1.0 - (rate / 200.0)) + noise_w = str(srange / 100.0) + text = html.unescape(say_text).replace('"', "'") + cmd = 'mimic3 -v ' + voice + \ + ' --length-scale ' + length_scale + \ + ' --noise_w ' + noise_w + \ + ' "' + text + '"' + os.system(cmd) + + def _speaker_picospeaker(pitch: int, rate: int, system_language: str, say_text: str) -> None: """TTS using picospeaker @@ -396,6 +419,8 @@ def _text_to_speech(say_str: str, screenreader: str, _speaker_espeak(espeak, pitch, rate, srange, say_str) elif screenreader == 'picospeaker': _speaker_picospeaker(pitch, rate, system_language, say_str) + elif screenreader == 'mimic3': + _speaker_mimic3(pitch, rate, system_language, say_str) def _say_command(content: str, say_str: str, screenreader: str, diff --git a/epicyon.py b/epicyon.py index f55158717..b82de1818 100644 --- a/epicyon.py +++ b/epicyon.py @@ -181,7 +181,8 @@ def _command_options() -> None: help='Nickname of the account to use') parser.add_argument('--screenreader', dest='screenreader', type=str, default=None, - help='Name of the screen reader: espeak/picospeaker') + help='Name of the screen reader: ' + + 'espeak/picospeaker/mimic3') parser.add_argument('--fol', '--follow', dest='follow', type=str, default=None, help='Handle of account to follow. eg. ' + diff --git a/install-desktop-client b/install-desktop-client index cf15c158c..c1ac5e83b 100755 --- a/install-desktop-client +++ b/install-desktop-client @@ -126,9 +126,24 @@ cp ~/epicyon-client ~/epicyon-client-pico chmod +x ~/epicyon-client-pico sed -i 's|epicyon.py|epicyon.py --screenreader picospeaker|g' ~/epicyon-client-pico +# TTS version with mimic3 +cp ~/epicyon-client ~/epicyon-client-mimic3 +chmod +x ~/epicyon-client-mimic3 +sed -i 's|epicyon.py|epicyon.py --screenreader mimic3|g' ~/epicyon-client-mimic3 + # TTS stream cp ~/epicyon-client ~/epicyon-client-stream chmod +x ~/epicyon-client-stream sed -i 's|epicyon.py|epicyon.py --notifyShowNewPosts --screenreader espeak|g' ~/epicyon-client-stream +# TTS stream +cp ~/epicyon-client ~/epicyon-stream-pico +chmod +x ~/epicyon-stream-pico +sed -i 's|epicyon.py|epicyon.py --notifyShowNewPosts --screenreader picospeaker|g' ~/epicyon-stream-pico + +# TTS stream +cp ~/epicyon-client ~/epicyon-stream-mimic3 +chmod +x ~/epicyon-stream-mimic3 +sed -i 's|epicyon.py|epicyon.py --notifyShowNewPosts --screenreader mimic3|g' ~/epicyon-stream-mimic3 + zenity --info --width=400 --text "Epicyon desktop client is now installed. You can run it with ~/epicyon-client" From d0841ba060244b32ace779a4cb1090ce375bf013 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 29 Jun 2022 23:03:42 +0100 Subject: [PATCH 02/19] Support for mimic3 tts --- desktop_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_client.py b/desktop_client.py index 3724a47e1..6caf5f5ae 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -1405,7 +1405,7 @@ def run_desktop_client(base_dir: str, proxy_type: str, http_prefix: str, if screenreader == 'espeak': print('Setting up espeak') from espeak import espeak - elif screenreader != 'picospeaker': + elif screenreader not in ('picospeaker', 'mimic3'): print(screenreader + ' is not a supported TTS system') return From b048e773814d8d208950d82b10f54a779bb7cc21 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 29 Jun 2022 23:07:42 +0100 Subject: [PATCH 03/19] convert to float --- desktop_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_client.py b/desktop_client.py index 6caf5f5ae..68a588f63 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -340,7 +340,7 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, if pitch > 75: voice = 'en_US/vctk_low' length_scale = str(1.0 - (rate / 200.0)) - noise_w = str(srange / 100.0) + noise_w = str(float(srange) / 100.0) text = html.unescape(say_text).replace('"', "'") cmd = 'mimic3 -v ' + voice + \ ' --length-scale ' + length_scale + \ From ec2db6a8828c84f767877926a88830d0c8011f6f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 29 Jun 2022 23:09:44 +0100 Subject: [PATCH 04/19] Use srange --- desktop_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop_client.py b/desktop_client.py index 68a588f63..a4b1f1b28 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -340,7 +340,7 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, if pitch > 75: voice = 'en_US/vctk_low' length_scale = str(1.0 - (rate / 200.0)) - noise_w = str(float(srange) / 100.0) + noise_w = str(srange / 100.0) text = html.unescape(say_text).replace('"', "'") cmd = 'mimic3 -v ' + voice + \ ' --length-scale ' + length_scale + \ @@ -420,7 +420,7 @@ def _text_to_speech(say_str: str, screenreader: str, elif screenreader == 'picospeaker': _speaker_picospeaker(pitch, rate, system_language, say_str) elif screenreader == 'mimic3': - _speaker_mimic3(pitch, rate, system_language, say_str) + _speaker_mimic3(pitch, rate, srange, say_str) def _say_command(content: str, say_str: str, screenreader: str, From 9ca77959444d1c82f01430e953b9a74485154b55 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 29 Jun 2022 23:11:15 +0100 Subject: [PATCH 05/19] Dash --- desktop_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_client.py b/desktop_client.py index a4b1f1b28..cc6e9d73f 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -344,7 +344,7 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, text = html.unescape(say_text).replace('"', "'") cmd = 'mimic3 -v ' + voice + \ ' --length-scale ' + length_scale + \ - ' --noise_w ' + noise_w + \ + ' --noise-w ' + noise_w + \ ' "' + text + '"' os.system(cmd) From fc7dff733e0e6a8d39714dd453a946eca1acb487 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 29 Jun 2022 23:14:56 +0100 Subject: [PATCH 06/19] Check for text --- desktop_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop_client.py b/desktop_client.py index cc6e9d73f..a22da94ec 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -342,6 +342,8 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, length_scale = str(1.0 - (rate / 200.0)) noise_w = str(srange / 100.0) text = html.unescape(say_text).replace('"', "'") + if not text: + return cmd = 'mimic3 -v ' + voice + \ ' --length-scale ' + length_scale + \ ' --noise-w ' + noise_w + \ From 80b1292d29ba4859a208f23203c982e883250ade Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 29 Jun 2022 23:22:22 +0100 Subject: [PATCH 07/19] Try async --- desktop_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_client.py b/desktop_client.py index a22da94ec..29d28b417 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -347,7 +347,7 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, cmd = 'mimic3 -v ' + voice + \ ' --length-scale ' + length_scale + \ ' --noise-w ' + noise_w + \ - ' "' + text + '"' + ' "' + text + '" &' os.system(cmd) From aaae4f16940339dc1d6e4b9e0ec292cbee65f341 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 29 Jun 2022 23:41:08 +0100 Subject: [PATCH 08/19] Play through aplay --- desktop_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop_client.py b/desktop_client.py index 29d28b417..ff3c62d4b 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -347,7 +347,8 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, cmd = 'mimic3 -v ' + voice + \ ' --length-scale ' + length_scale + \ ' --noise-w ' + noise_w + \ - ' "' + text + '" &' + ' --play-program aplay' + \ + ' "' + text + '"' os.system(cmd) From 085c8e8eeda960ca26f1a5f1e353f296b4a3debe Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 29 Jun 2022 23:47:06 +0100 Subject: [PATCH 09/19] mimic3 command --- desktop_client.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/desktop_client.py b/desktop_client.py index ff3c62d4b..783c0b38a 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -346,9 +346,8 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, return cmd = 'mimic3 -v ' + voice + \ ' --length-scale ' + length_scale + \ - ' --noise-w ' + noise_w + \ - ' --play-program aplay' + \ - ' "' + text + '"' + ' --noise-w ' + noise_w + ' --stdout' + \ + ' "' + text + '" 2> /dev/null | aplay 2> /dev/null &' os.system(cmd) From 7814fac9ba4e33aa9c4b17224376f7f5b2603211 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Jun 2022 11:53:45 +0100 Subject: [PATCH 10/19] Playing audio with mimic3 --- desktop_client.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/desktop_client.py b/desktop_client.py index 783c0b38a..aad15ee5e 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -16,6 +16,7 @@ import webbrowser import urllib.parse from pathlib import Path from random import randint +from subprocess import call from utils import text_in_file from utils import disallow_announce from utils import disallow_reply @@ -344,11 +345,16 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, text = html.unescape(say_text).replace('"', "'") if not text: return + audio_filename = '/tmp/epicyon_voice.wav' cmd = 'mimic3 -v ' + voice + \ ' --length-scale ' + length_scale + \ ' --noise-w ' + noise_w + ' --stdout' + \ - ' "' + text + '" 2> /dev/null | aplay 2> /dev/null &' - os.system(cmd) + ' "' + text + '" > ' + audio_filename + try: + os.system(cmd) + call(['aplay', audio_filename]) + except OSError: + print('EX: unable to play ' + audio_filename) def _speaker_picospeaker(pitch: int, rate: int, system_language: str, From 250c351355788b93afabd7183cad10cc48eb8034 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Jun 2022 12:06:32 +0100 Subject: [PATCH 11/19] playing mimic3 sound --- desktop_client.py | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/desktop_client.py b/desktop_client.py index aad15ee5e..c12a1bef2 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -16,7 +16,6 @@ import webbrowser import urllib.parse from pathlib import Path from random import randint -from subprocess import call from utils import text_in_file from utils import disallow_announce from utils import disallow_reply @@ -327,6 +326,18 @@ def _speaker_espeak(espeak, pitch: int, rate: int, srange: int, espeak.synth(html.unescape(say_text)) +def _play_notification_sound(sound_filename: str, + player: str = 'ffplay') -> None: + """Plays a sound + """ + if not os.path.isfile(sound_filename): + return + + if player == 'ffplay': + os.system('ffplay ' + sound_filename + + ' -autoexit -hide_banner -nodisp 2> /dev/null') + + def _speaker_mimic3(pitch: int, rate: int, srange: int, say_text: str) -> None: """Speaks the given text with mimic3 @@ -348,13 +359,13 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, audio_filename = '/tmp/epicyon_voice.wav' cmd = 'mimic3 -v ' + voice + \ ' --length-scale ' + length_scale + \ - ' --noise-w ' + noise_w + ' --stdout' + \ + ' --noise-w ' + noise_w + \ ' "' + text + '" > ' + audio_filename try: os.system(cmd) - call(['aplay', audio_filename]) - except OSError: - print('EX: unable to play ' + audio_filename) + except OSError as ex: + print('EX: unable to play ' + audio_filename + ' ' + str(ex)) + _play_notification_sound(audio_filename) def _speaker_picospeaker(pitch: int, rate: int, system_language: str, @@ -381,18 +392,6 @@ def _speaker_picospeaker(pitch: int, rate: int, system_language: str, os.system(speaker_cmd) -def _play_notification_sound(sound_filename: str, - player: str = 'ffplay') -> None: - """Plays a sound - """ - if not os.path.isfile(sound_filename): - return - - if player == 'ffplay': - os.system('ffplay ' + sound_filename + - ' -autoexit -hide_banner -nodisp 2> /dev/null') - - def _desktop_notification(notification_type: str, title: str, message: str) -> None: """Shows a desktop notification From 25e5635c8693511368d511d2bc1748f6a5125d2c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Jun 2022 12:10:28 +0100 Subject: [PATCH 12/19] Shorter function name --- desktop_client.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/desktop_client.py b/desktop_client.py index c12a1bef2..f8eb7782b 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -316,17 +316,7 @@ def _desktop_wait_for_cmd(timeout: int, debug: bool) -> str: return None -def _speaker_espeak(espeak, pitch: int, rate: int, srange: int, - say_text: str) -> None: - """Speaks the given text with espeak - """ - espeak.set_parameter(espeak.Parameter.Pitch, pitch) - espeak.set_parameter(espeak.Parameter.Rate, rate) - espeak.set_parameter(espeak.Parameter.Range, srange) - espeak.synth(html.unescape(say_text)) - - -def _play_notification_sound(sound_filename: str, +def _play_sound(sound_filename: str, player: str = 'ffplay') -> None: """Plays a sound """ @@ -338,6 +328,16 @@ def _play_notification_sound(sound_filename: str, ' -autoexit -hide_banner -nodisp 2> /dev/null') +def _speaker_espeak(espeak, pitch: int, rate: int, srange: int, + say_text: str) -> None: + """Speaks the given text with espeak + """ + espeak.set_parameter(espeak.Parameter.Pitch, pitch) + espeak.set_parameter(espeak.Parameter.Rate, rate) + espeak.set_parameter(espeak.Parameter.Range, srange) + espeak.synth(html.unescape(say_text)) + + def _speaker_mimic3(pitch: int, rate: int, srange: int, say_text: str) -> None: """Speaks the given text with mimic3 @@ -365,7 +365,7 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, os.system(cmd) except OSError as ex: print('EX: unable to play ' + audio_filename + ' ' + str(ex)) - _play_notification_sound(audio_filename) + _play_sound(audio_filename) def _speaker_picospeaker(pitch: int, rate: int, system_language: str, @@ -1533,7 +1533,7 @@ def run_desktop_client(base_dir: str, proxy_type: str, http_prefix: str, "Epicyon", "New DM " + your_actor + '/dm') if notification_sounds: - _play_notification_sound(dm_sound_filename, player) + _play_sound(dm_sound_filename, player) if notify_json.get('repliesNotify'): if notify_json.get('repliesNotifyChanged'): _desktop_notification(notification_type, @@ -1541,7 +1541,7 @@ def run_desktop_client(base_dir: str, proxy_type: str, http_prefix: str, "New reply " + your_actor + '/replies') if notification_sounds: - _play_notification_sound(reply_sound_filename, player) + _play_sound(reply_sound_filename, player) if box_json: timeline_first_id = _get_first_item_id(box_json) From 7c82bd0dba92f2bbed0bf816bef76281ba83c11d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Jun 2022 12:12:51 +0100 Subject: [PATCH 13/19] Indentation --- desktop_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_client.py b/desktop_client.py index f8eb7782b..440a2a350 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -317,7 +317,7 @@ def _desktop_wait_for_cmd(timeout: int, debug: bool) -> str: def _play_sound(sound_filename: str, - player: str = 'ffplay') -> None: + player: str = 'ffplay') -> None: """Plays a sound """ if not os.path.isfile(sound_filename): From be00e5144daf6277195d6274c2ec00b597926288 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Jun 2022 12:33:12 +0100 Subject: [PATCH 14/19] Debug --- desktop_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop_client.py b/desktop_client.py index 440a2a350..44f9712a5 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -360,7 +360,9 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, cmd = 'mimic3 -v ' + voice + \ ' --length-scale ' + length_scale + \ ' --noise-w ' + noise_w + \ + ' --stdout' + \ ' "' + text + '" > ' + audio_filename + print(cmd) try: os.system(cmd) except OSError as ex: From ce2033123fa6574ecfcfe449ae4d67d45b3cb5a3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Jun 2022 12:40:53 +0100 Subject: [PATCH 15/19] srange check --- desktop_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop_client.py b/desktop_client.py index 44f9712a5..6317c746f 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -352,6 +352,8 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, if pitch > 75: voice = 'en_US/vctk_low' length_scale = str(1.0 - (rate / 200.0)) + if srange > 100: + srange = 100 noise_w = str(srange / 100.0) text = html.unescape(say_text).replace('"', "'") if not text: @@ -362,7 +364,6 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, ' --noise-w ' + noise_w + \ ' --stdout' + \ ' "' + text + '" > ' + audio_filename - print(cmd) try: os.system(cmd) except OSError as ex: From 2601fd2e1ee6dbb08241bab09b68621f59598500 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Jun 2022 12:45:45 +0100 Subject: [PATCH 16/19] Sleep after mimic3 play --- desktop_client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop_client.py b/desktop_client.py index 6317c746f..f3821a675 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -369,6 +369,7 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, except OSError as ex: print('EX: unable to play ' + audio_filename + ' ' + str(ex)) _play_sound(audio_filename) + time.sleep(4) def _speaker_picospeaker(pitch: int, rate: int, system_language: str, From f6b2fed3f51315e472ff9f577525e64554db37bc Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Jun 2022 12:49:37 +0100 Subject: [PATCH 17/19] Change rates for mimic3 --- desktop_client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/desktop_client.py b/desktop_client.py index f3821a675..04ae29650 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -351,7 +351,7 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, voice = 'en_US/ljspeech_low' if pitch > 75: voice = 'en_US/vctk_low' - length_scale = str(1.0 - (rate / 200.0)) + length_scale = str(1.0 - (rate / 600.0)) if srange > 100: srange = 100 noise_w = str(srange / 100.0) @@ -369,7 +369,6 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, except OSError as ex: print('EX: unable to play ' + audio_filename + ' ' + str(ex)) _play_sound(audio_filename) - time.sleep(4) def _speaker_picospeaker(pitch: int, rate: int, system_language: str, From 9868ebd1c75a47e54103c4ccf4a99cc0ac4ef778 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Jun 2022 12:56:35 +0100 Subject: [PATCH 18/19] Less screen output --- desktop_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop_client.py b/desktop_client.py index 04ae29650..2a01fb75f 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -363,7 +363,8 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, ' --length-scale ' + length_scale + \ ' --noise-w ' + noise_w + \ ' --stdout' + \ - ' "' + text + '" > ' + audio_filename + ' "' + text + '" > ' + \ + audio_filename + ' 2> /dev/null' try: os.system(cmd) except OSError as ex: From 739188c7ac9a06874ec2d5af3eb053b1c413260e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Jun 2022 12:57:04 +0100 Subject: [PATCH 19/19] Slower voices --- desktop_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_client.py b/desktop_client.py index 2a01fb75f..fa1643087 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -351,7 +351,7 @@ def _speaker_mimic3(pitch: int, rate: int, srange: int, voice = 'en_US/ljspeech_low' if pitch > 75: voice = 'en_US/vctk_low' - length_scale = str(1.0 - (rate / 600.0)) + length_scale = str(1.2 - (rate / 600.0)) if srange > 100: srange = 100 noise_w = str(srange / 100.0)