hasscc / hass-edge-tts

🗣️ Microsoft Edge TTS for Home Assistant, no need for app_key
357 stars 62 forks source link

Consider Integrating VoiceManager to hass-edge-tts #30

Open rany2 opened 1 year ago

rany2 commented 1 year ago

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.

al-one commented 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()
rany2 commented 1 year ago

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.