Skip to content

Commit

Permalink
docs: tts
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEVolk committed Jan 31, 2023
1 parent 51d4c97 commit d5b7478
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# yandex-alice-client
![Downloads](https://img.shields.io/npm/dm/yandex-alice-client.svg)

Клиент для отправки запросов Яндекс Алисе и получения от неё ответов.

## Преимущества
* Минимальное количество зависимостей 💭
* Поддержка TypeScript типизации 🪑
* Удобный и простой API 🚀
* TTS 📣

## Как использовать
```js
import YandexAliceClient from 'yandex-alice-client';
Expand All @@ -13,12 +20,18 @@ await client.connect();
const { response } = await client.sendText('hello world');
console.log(response.card.text);

// Alice TTS
const { audio } = await client.sendText('hello world', true);
// Alice with TTS
const { audio } = await client.sendText('hello world', { isTTS: true });
console.log(audio); // buffer (audio/opus)

await writeFile('response.opus', audio);

// TTS
const audio = await client.sendText('что за чудеса происходят?', { voice: 'levitan' });
console.log(audio); // buffer (audio/opus)
await writeFile('response.opus', audio);

// close client connection
await client.close();
```

Expand All @@ -32,4 +45,6 @@ await client.close();
* Привязка к аккаунту и отправка запросов от настоящей колонки
* sendAudio или streamAudio чтобы отправлять голосовые команды

Пусть это будет некое виртуальное yandexio, точнее его часть, что общается с Алисой.
Пусть это будет некое виртуальное yandexio, точнее его часть, что общается с Алисой.

> С любовью к Яндекс ❤️
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"keywords": [
"yandex",
"alice",
"iot"
"iot",
"tts"
],
"main": "lib/index.js",
"types": "./lib/index.d.ts",
Expand All @@ -21,7 +22,7 @@
"engines": {
"node": ">=12.20.0"
},
"version": "0.3.0",
"version": "0.3.1",
"dependencies": {
"uuid": "^9.0.0",
"ws": "^8.12.0"
Expand Down

0 comments on commit d5b7478

Please sign in to comment.