Skip to content

Instantly share code, notes, and snippets.

@Nehc
Forked from AlexxIT/alice.py
Created August 6, 2020 05:52
Show Gist options
  • Save Nehc/bc13b556150bae4921f809b962f8de8e to your computer and use it in GitHub Desktop.
Save Nehc/bc13b556150bae4921f809b962f8de8e to your computer and use it in GitHub Desktop.
TTS на колонках с Алисой из командной строки
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