From e57b949ffebc0f4a39007efc1b82d7e864e28077 Mon Sep 17 00:00:00 2001 From: drosoCode Date: Tue, 5 Mar 2024 22:45:32 +0100 Subject: [PATCH] update readme --- README.md | 6 +++++- scripts/voice/play.py | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 21ac79a..d448bd7 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ An opensource nabaztag/nabaztag:tag/karotz server. Make sure that you have cloned this repo with the option `--recurse-submodules`. +Warning: This project is in a very early stage, it has not been fully tested and is not (yet) recommended to use for an extended period of time. + Ports: - tcp/80: For V1/V2 (to download bootcode) - udp/4000: For V2 (to send/receive audio) @@ -29,10 +31,12 @@ Run `scripts/nats.sh` to run the nats server. Run `make run` to build the openab server and run it. +Press the head of the nabaztag:tag while powering it (all leds should be blue), connect to the new wifi (NabaztagXX) and go to `192.168.0.1` and at the bottom of the page, change the `Violet Platform` field to the address of the pc running the server (ex: `http://192.168.1.102/vl`), then click `update and start`. + Go into `scripts/voice`: - install the requirements: `pip3 install -r requirements.txt` - clone [wyoming-satellite](https://github.com/rhasspy/wyoming-satellite/) - run `cd wyoming-satellite && script/setup` - make sure to also install the webrtc utils `cd wyoming-satellite && .venv/bin/pip3 install 'webrtc-noise-gain==1.2.3'` - turn on your nabaztag and wait for it to connect to the server - - run `./voice.sh` + - run `./voice.sh` (currently you need to restart this script, the server and the nab after each voice command) diff --git a/scripts/voice/play.py b/scripts/voice/play.py index 65d449c..ccabad7 100755 --- a/scripts/voice/play.py +++ b/scripts/voice/play.py @@ -11,6 +11,10 @@ async def main(): print("Player Connected") + async def blank(): + for i in range(30): + await send(b'0'*1024) + async def send(audio): inbox = nc.new_inbox() sub = await nc.subscribe(inbox) @@ -31,6 +35,7 @@ async def send(audio): if not was_streaming: # stop the recorder while we send audio await nc.publish(f"openab.{cfg.MAC}.recorder.command", bytes(json.dumps({"state": 1}), "utf8")) + await blank() was_streaming = True lastread = time() data += r @@ -38,10 +43,11 @@ async def send(audio): await send(data) data = b'' elif was_streaming: - if time()-lastread > 2: + if time()-lastread > 1: print("End of stream") if len(data) > 0: await send(data) + await blank() was_streaming = False break except BlockingIOError: