-
-
Save Nehc/bc13b556150bae4921f809b962f8de8e to your computer and use it in GitHub Desktop.
TTS на колонках с Алисой из командной строки
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 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