mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 17:51:20 +00:00
23 lines
558 B
Python
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')
|