Last active
February 9, 2018 14:56
-
-
Save tsu-nera/9eb3718e70cb3c8adce71ab8f6523528 to your computer and use it in GitHub Desktop.
google-homeで時報
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pychromecast | |
def play_mp3(mp3_url): | |
cast.wait() | |
mc = cast.media_controller | |
mc.play_media(mp3_url, 'audio/mp3') | |
mc.block_until_active() | |
chromecast_name = "つーねらの部屋" | |
chromecasts = pychromecast.get_chromecasts() | |
cast = next(cc for cc in chromecasts if cc.device.friendly_name == chromecast_name) | |
play_mp3("https://ultra.zone/file/jihou-sine-3f.mp3") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment