Merge branch 'master' of gitlab.com:hugvey/hugvey
This commit is contained in:
commit
0aafc3209f
9 changed files with 383 additions and 370 deletions
|
@ -93,7 +93,7 @@ chown=pi:pi
|
|||
## Deploy / usefull commands
|
||||
|
||||
```bash
|
||||
for i in {1..6}; do rsync -av ~/hugvey/ pi@hugvey$i.local:/home/pi/hugvey/ --exclude=www --exclude=venv --exclude=local --exclude=*.pyc --exclude=.git; done
|
||||
for i in {1..26}; do echo $i; rsync -av ~/hugvey/ pi@hugvey$i.local:/home/pi/hugvey/ --exclude=www --exclude=venv --exclude=local --exclude=*.pyc --exclude=.git --exclude=recordings --exclude=/voice* --exclude=/pd; done
|
||||
```
|
||||
|
||||
```bash
|
||||
|
|
|
@ -5,7 +5,7 @@ voice:
|
|||
input_rate: 44100
|
||||
target_rate: 16000
|
||||
port: 4444
|
||||
input_name: 'AK5371'
|
||||
input_name: 'USB Audio Device'
|
||||
output_name: 'USB Audio Device'
|
||||
input_mixer: 'Mic'
|
||||
output_mixer: 'PCM'
|
||||
|
@ -13,6 +13,3 @@ voice:
|
|||
output_volume: 30
|
||||
file_address: "http://hugveycmd.local:8888"
|
||||
output_driver: pulseaudio
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ from hugvey.voice import VoiceStorage
|
|||
import multiprocessing
|
||||
from hugvey.speech.recorder import Recorder
|
||||
from pythonosc import udp_client
|
||||
import copy
|
||||
|
||||
mainLogger = logging.getLogger("hugvey")
|
||||
|
||||
|
@ -709,7 +710,7 @@ class HugveyState(object):
|
|||
await asyncio.sleep(1)
|
||||
|
||||
self.streamer.triggerStart()
|
||||
self.story.setStoryData(self.command.languages[self.language_code])
|
||||
self.story.setStoryData(copy.deepcopy(self.command.languages[self.language_code]))
|
||||
self.setLightStatus(False)
|
||||
await self.story.run(startMsgId)
|
||||
# self.story = None
|
||||
|
|
|
@ -13,6 +13,7 @@ import faulthandler
|
|||
from zmq.asyncio import Context
|
||||
import zmq
|
||||
import wave
|
||||
import sox
|
||||
from pythonosc import udp_client
|
||||
import random
|
||||
|
||||
|
@ -1419,10 +1420,7 @@ class Story(object):
|
|||
|
||||
# get duration of audio file, so the client can detect a hang of 'play'
|
||||
try:
|
||||
with wave.open(fn,'r') as fp:
|
||||
frames = fp.getnframes()
|
||||
rate = fp.getframerate()
|
||||
duration = frames/float(rate)
|
||||
duration = sox.file_info.duration(fn)
|
||||
except Exception as e:
|
||||
self.hugvey.eventLogger.critical(f"error: crash when reading wave file: {fn}")
|
||||
self.logger.critical(f"error: crash when reading wave file: {fn}")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
apt-get update
|
||||
|
||||
apt-get install -y munin-node bc supervisor libsox-fmt-pulse
|
||||
apt-get install -y munin-node bc supervisor
|
||||
cp installation/rpi-internal-temp /usr/share/munin/plugins
|
||||
ln -sf /usr/share/munin/plugins/rpi-internal-temp /etc/munin/plugins/rpi-internal-temp
|
||||
rm /etc/munin/plugins/irqstats
|
||||
|
|
|
@ -1,34 +1,51 @@
|
|||
#N canvas 223 291 679 478 10;
|
||||
#X obj 155 392 dac~;
|
||||
#X obj 155 342 readsf~;
|
||||
#X msg 81 297 0;
|
||||
#X obj 233 324 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
|
||||
#N canvas 200 136 660 592 10;
|
||||
#X obj 131 277 dac~;
|
||||
#X obj 131 227 readsf~;
|
||||
#X obj 209 209 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
|
||||
-1 -1;
|
||||
#X text 252 322 (re-)start loop;
|
||||
#X obj 239 60 oscparse;
|
||||
#X obj 239 85 list trim;
|
||||
#X obj 239 38 netreceive -u -b 5555;
|
||||
#X obj 339 163 route 1;
|
||||
#X obj 425 162 route 0;
|
||||
#X obj 339 119 route trigger;
|
||||
#X text 69 276 stop loop;
|
||||
#X obj 469 216 print "starting loop";
|
||||
#X obj 470 239 print "stopping loop";
|
||||
#X msg 155 244 open testaudio.wav \, 1;
|
||||
#X text 237 17 listen to osc at port 5555;
|
||||
#X text 155 219 change audiofile HERE;
|
||||
#X text 229 206 (re-)start loop;
|
||||
#X msg 132 170 open /home/a/projects/pd-play/testaudio.wav \, 1;
|
||||
#X obj 208 459 netsend -u -b;
|
||||
#X obj 208 481 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
|
||||
1;
|
||||
#X msg 355 464 disconnect;
|
||||
#X obj 208 393 list prepend send;
|
||||
#X obj 208 415 list trim;
|
||||
#X msg 357 434 connect localhost 5555;
|
||||
#X obj 208 345 oscformat /trigger;
|
||||
#X msg 51 193 0;
|
||||
#X obj 227 83 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
|
||||
-1;
|
||||
#X text 40 173 stop loop;
|
||||
#X msg 210 292 1;
|
||||
#X obj 318 84 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
|
||||
-1;
|
||||
#X text 217 60 START;
|
||||
#X obj 436 84 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
|
||||
1;
|
||||
#X text 309 61 !STOP!;
|
||||
#X text 422 60 Playing indicator;
|
||||
#X msg 261 118 1;
|
||||
#X msg 330 117 0;
|
||||
#X connect 1 0 0 0;
|
||||
#X connect 1 0 0 1;
|
||||
#X connect 1 1 3 0;
|
||||
#X connect 2 0 1 0;
|
||||
#X connect 3 0 14 0;
|
||||
#X connect 1 1 2 0;
|
||||
#X connect 2 0 4 0;
|
||||
#X connect 2 0 15 0;
|
||||
#X connect 4 0 1 0;
|
||||
#X connect 5 0 6 0;
|
||||
#X connect 6 0 10 0;
|
||||
#X connect 7 0 5 0;
|
||||
#X connect 8 0 3 0;
|
||||
#X connect 8 0 12 0;
|
||||
#X connect 9 0 2 0;
|
||||
#X connect 9 0 13 0;
|
||||
#X connect 10 0 8 0;
|
||||
#X connect 10 0 9 0;
|
||||
#X connect 14 0 1 0;
|
||||
#X connect 8 0 9 0;
|
||||
#X connect 9 0 5 0;
|
||||
#X connect 10 0 5 0;
|
||||
#X connect 11 0 8 0;
|
||||
#X connect 12 0 1 0;
|
||||
#X connect 13 0 10 0;
|
||||
#X connect 13 0 2 0;
|
||||
#X connect 13 0 21 0;
|
||||
#X connect 15 0 11 0;
|
||||
#X connect 16 0 12 0;
|
||||
#X connect 16 0 7 0;
|
||||
#X connect 16 0 22 0;
|
||||
#X connect 21 0 18 0;
|
||||
#X connect 22 0 18 0;
|
||||
|
|
|
@ -25,7 +25,7 @@ while(1):
|
|||
print("sending start to {0} on port {1}".format(args.ip, args.port))
|
||||
client.send_message("/trigger", 1)
|
||||
time.sleep(2)
|
||||
print("sending stop to {0} on port {1}".format(args.ip, args.port))
|
||||
print("sending start to {0} on port {1}".format(args.ip, args.port))
|
||||
client.send_message("/trigger", 0)
|
||||
time.sleep(2)
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ voice:
|
|||
port: 4444
|
||||
chunk: 2972
|
||||
google_credentials: "../test_googlespeech/My First Project-0c7833e0d5fa.json"
|
||||
hugveys: 25
|
||||
hugveys: 26
|
||||
languages:
|
||||
- code: en-GB
|
||||
file: story_en.json
|
||||
|
|
|
@ -147,4 +147,4 @@ class Timeline{
|
|||
}
|
||||
}
|
||||
|
||||
var tl = new Timeline(ws, document.getElementById('line'), 25);
|
||||
var tl = new Timeline(ws, document.getElementById('line'), 26);
|
||||
|
|
Loading…
Reference in a new issue