Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aoirint/jasmine_zinc

方針検討中
https://github.com/aoirint/jasmine_zinc

Last synced: about 1 month ago
JSON representation

方針検討中

Awesome Lists containing this project

README

        

# Jasmine Zinc

## Usage: Module

### get_avatars
```python
from jasmine_zinc import get_avatars

avatars = get_avatars(
server_url='http://user:password@server_ip:7180',
)

print(avatars)
```

### talk_on_server
```python
from jasmine_zinc import talk_on_server, Talk

result = talk_on_server(
server_url='http://user:password@server_ip:7180',
cid=5201,
talk=Talk(
talktext='てすと',
),
)

print(result.message)
```

### record_talk
```python
from jasmine_zinc import record_talk, Talk

result = record_talk(
server_url='http://user:password@server_ip:7180',
cid=5201,
talk=Talk(
talktext='てすと',
),
frequency=48000,
)

from playsound import playsound
import tempfile

with tempfile.NamedTemporaryFile() as fp:
fp.write(result.wave_binary)

playsound(fp.name)
```

## Usage: Console Scripts
### Environment Variables
```env
SERVER_URL=http://user:password@server_ip:7180
```

### jaz_get_avatars
Fetch avatar list (`cid`, `name`, etc.). Currently, the output format is work in progress.

```shell
jaz_get_avatars --server-url=http://user:password@server_ip:7180

export SERVER_URL=http://user:password@server_ip:7180
jaz_get_avatars
```

### jaz_talk_on_server
Talk on server.

```shell
jaz_talk_on_server -cid 5201 -t "talktext" --server-url=http://user:password@server_ip:7180

export SERVER_URL=http://user:password@server_ip:7180
jaz_talk_on_server -cid 5201 -t "talktext"

echo "talktext" | jaz_talk_on_server -cid 5201 -f /dev/stdin
```

### jaz_record_talk
Record a talk voice on server, download as a wave file and play on client.

```shell
jaz_record_talk -cid 5201 -t "talktext" --server-url=http://user:password@server_ip:7180

export SERVER_URL=http://user:password@server_ip:7180
jaz_record_talk -cid 5201 -t "talktext"

echo "talktext" | jaz_record_talk -cid 5201 -f /dev/stdin
```

## Development: Test Console Scripts
### Create .env file
```env
SERVER_URL=http://user:password@server_ip:7180
```

### Execute
```shell
./scripts/get_avatars

./scripts/talk_on_server 5201 てすと

./scripts/record_talk 5201 てすと
```

## Development: Load env vars from .env file
```shell
export $(cat .env | xargs)
```