From ac26131b71a3448d623a3f25144fee4c6e667e7e Mon Sep 17 00:00:00 2001 From: "Matthew D. Scholefield" Date: Wed, 18 Apr 2018 10:59:23 -0500 Subject: [PATCH] Fix SSML when tag spans multiple sentences Now, sentence splitting is disabled if the utterance contains any xml tags --- mycroft/audio/speech.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mycroft/audio/speech.py b/mycroft/audio/speech.py index ad1a5d2fe0..9c7cb1f68b 100644 --- a/mycroft/audio/speech.py +++ b/mycroft/audio/speech.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import time import re - +import time from threading import Lock + from mycroft.configuration import Configuration +from mycroft.metrics import report_timing, Stopwatch from mycroft.tts import TTSFactory from mycroft.util import create_signal, check_for_signal from mycroft.util.log import LOG -from mycroft.metrics import report_timing, Stopwatch ws = None # TODO:18.02 - Rename to "messagebus" config = None @@ -69,7 +69,8 @@ def handle_speak(event): # # TODO: Remove or make an option? This is really a hack, anyway, # so we likely will want to get rid of this when not running on Mimic - if not config.get('enclosure', {}).get('platform') == "picroft": + if (config.get('enclosure', {}).get('platform') != "picroft" and + len(re.findall('<[^>]*>', utterance)) == 0): start = time.time() chunks = re.split(r'(?