Open rany2 opened 1 year ago
I think the voice list should be cached in hass storage instead of getting it from the cloud every time. Even if the voice list fails to be fetched from the cloud next time, the voices in the old cache can still be used.
from homeassistant.helpers.storage import Store
store = Store(hass, 1, 'edge-voices.json')
voices = await store.async_load()
This sounds like a good idea, I'll add a way to have VoiceManager use a custom voice list that HASS could provide. You could currently get the voice list from list_voices(), needs to be cached by HASS.
Have a look at https://github.com/rany2/edge-tts/blob/master/examples/dynamic_voice_selection.py to see if it is feasible to integrate.