I'm testing the new version (v1.0.7) with a development version of Home Assistant and am having trouble getting some XML to work. Including simple tags like <break time="2s" />
works as expected. However, when trying to use some of the style examples that Microsoft has, I'm getting an error.
Per Microsoft's documentation, this is a full example to configure the voice style:
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"
xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="en-US">
<voice name="en-US-JennyNeural">
<mstts:express-as style="cheerful">
That'd be just amazing!
</mstts:express-as>
</voice>
</speak>
It looks like your code is already setting the Speak and Voice tags, so I tried passing just the following text. But when I do, I get an error.
<mstts:express-as style="cheerful">That'd be just amazing!</mstts:express-as>
2022-11-07 19:22:09.633 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139668934221904] Error handling message: Unknown error (unknown_error) from 127.0.0.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0)
Traceback (most recent call last):
File "/home/steve/ha/home-assistant-core/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/home/steve/ha/home-assistant-core/homeassistant/components/media_source/__init__.py", line 192, in websocket_resolve_media
media = await async_resolve_media(hass, msg["media_content_id"])
File "/home/steve/ha/home-assistant-core/homeassistant/components/media_source/__init__.py", line 155, in async_resolve_media
return await item.async_resolve()
File "/home/steve/ha/home-assistant-core/homeassistant/components/media_source/models.py", line 83, in async_resolve
return await self.async_media_source().async_resolve_media(self)
File "/home/steve/ha/home-assistant-core/homeassistant/components/tts/media_source.py", line 117, in async_resolve_media
url = await manager.async_get_url_path(
File "/home/steve/ha/home-assistant-core/homeassistant/components/tts/__init__.py", line 423, in async_get_url_path
filename = await self._async_get_tts_audio(
File "/home/steve/ha/home-assistant-core/homeassistant/components/tts/__init__.py", line 489, in _async_get_tts_audio
extension, data = await provider.async_get_tts_audio(message, language, options)
File "/home/steve/ha/home-assistant-core/homeassistant/components/tts/__init__.py", line 676, in async_get_tts_audio
return await self.hass.async_add_executor_job(
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/steve/ha/home-assistant-core/homeassistant/components/microsoft/tts.py", line 188, in get_tts_audio
data = trans.speak(
File "/home/steve/ha/home-assistant-core/venv/lib/python3.10/site-packages/pycsspeechtts/pycsspeechtts.py", line 71, in speak
voice.append(ElementTree.XML('<prosody>'+text+'</prosody>'))
File "/usr/lib/python3.10/xml/etree/ElementTree.py", line 1342, in XML
parser.feed(text)
xml.etree.ElementTree.ParseError: unbound prefix: line 1, column 9
Please let me know what I can do to help troubleshoot this. Thanks!