Merge pull request #210 from UniversityRadioYork/mstratford/silence-threshold

Fix silence detection threshold.
This commit is contained in:
Matthew Stratford 2021-02-08 20:53:43 +00:00 committed by GitHub
commit 9be4285c32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,8 @@ import { useInterval } from "../lib/utils";
import { RootState } from "../rootReducer";
import "./timelord.scss";
const SILENCE_WARN_SECS = 5;
export function Timelord() {
async function getSource() {
let studio = await myradioApiRequest("/selector/studioattime", "GET", null);
@ -32,7 +34,7 @@ export function Timelord() {
async function getSilence() {
let silence = await myradioApiRequest("/selector/issilence", "GET", null);
return silence;
return silence >= SILENCE_WARN_SECS;
}
const broadcastStage = useSelector(