Created
August 6, 2020 04:42
-
-
Save AlexxIT/0ba110a4e1214eeac21d2f942f28a1d7 to your computer and use it in GitHub Desktop.
TTS на колонках с Алисой из командной строки
This file contains hidden or 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 asyncio | |
import sys | |
from os import path | |
from aiohttp import ClientSession | |
from custom_components.yandex_station.yandex_quasar import YandexQuasar | |
async def main(cachefile: str, text: str): | |
async with ClientSession() as session: | |
quasar = YandexQuasar(session) | |
speakers = await quasar.init('myuser', 'mypass', cachefile) | |
for speaker in speakers: | |
if speaker['name'] == 'Яндекс Мини': | |
await quasar.send(speaker, text, is_tts=True) | |
if __name__ == '__main__': | |
text = ' '.join(sys.argv[1:]) | |
cachefile = path.join(path.dirname(path.abspath(__file__)), | |
'.yandex_station.json') | |
asyncio.run(main(cachefile, text)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Что то консольная Алиса совсем сломалась. Не работают скрипты(( Это у меня что то не так или Яндекс опять всё поломал?