2021-02-25 20:40:58 +01:00

23 lines
558 B
Python

from gtts import gTTSimport time
import pychromecast
from gtts import gTTS
casts, browser = pychromecast.get_chromecasts()
pychromecast.discovery.stop_discovery(browser)
if len(casts) == 0:
print("No Devices Found")
sys.exit(1)
print("Found cast devices:")
for cast in casts:
print(
' "{}" on mDNS service {} with UUID:{}'.format(
cast.name, cast._services, cast.uuid # pylint: disable=protected-access
)
)
print(casts[0])
tts = gTTS(text='Coucou petit asticot' , lang='fr')
tts.save('./hello_world_ja.mp3')