Skip to content

Commit

Permalink
Fix PR ivadim#21 for use on rpi
Browse files Browse the repository at this point in the history
When trying to build on my Pi I needed to add setuptools, and I've also included my fix for the audio system constantly re-initialising.
  • Loading branch information
AJDurant committed Apr 5, 2021
1 parent 7f309e1 commit 892166a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions fruitnanny/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN echo 'APT::Install-Recommends "false";' >/etc/apt/apt.conf.d/00recommends \
libgpiod2 \
python3 \
python3-pip \
python3-setuptools \
wiringpi \
&& pip3 install --upgrade RPI.GPIO adafruit-blinka adafruit-circuitpython-dht \
&& apt-get --purge -y autoremove && apt-get clean && rm -rf /tmp/* && rm -rf /var/lib/apt/lists/*
Expand Down
7 changes: 3 additions & 4 deletions fruitnanny/public/project/js/stream-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var StreamContext = (function() {
var unmutecallback = null;

var init = function(stream) {
if (initialized) return;
current_stream = stream;
if (source === null) {
source = audioContext.createMediaStreamSource(stream);
Expand All @@ -32,9 +33,7 @@ var StreamContext = (function() {
gain.gain.value = 1;

source.connect(analyser);
analyser.connect(gain)

gain.connect(audioContext.destination);
source.connect(gain).connect(audioContext.destination);
initialized = true;
}

Expand Down Expand Up @@ -141,4 +140,4 @@ var StreamContext = (function() {
audioByteFrequencyData: audioByteFrequencyData,
}

}())
}())

0 comments on commit 892166a

Please sign in to comment.