Merge pull request #590 from croisez/main

New feature: shifting down birdsongs in frequency for earing impaired people
This commit is contained in:
ehpersonal38
2022-10-03 10:50:05 -04:00
committed by GitHub
8 changed files with 407 additions and 19 deletions
+16
View File
@@ -115,6 +115,22 @@ CONFIDENCE=0.7
SENSITIVITY=1.25
## Configuration of the frequency shifting feature, useful for earing impaired people.
## FREQSHIFT_TOOL
FREQSHIFT_TOOL=sox
## If the tool is ffmpeg, you have to define a freq. shift from HI to LO:
## FREQSHIFT_HI
FREQSHIFT_HI=6000
## FREQSHIFT_LO
FREQSHIFT_LO=3000
## If the tool is sox, you have to define the pitch shift (amount of 100ths of semitone)
## FREQSHIFT_PITCH
FREQSHIFT_PITCH=-1500
## CHANNELS holds the variable that corresponds to the number of channels the
## sound card supports.
+74
View File
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 330 330"
style="enable-background:new 0 0 330 330;"
xml:space="preserve"
sodipodi:docname="shift.svg"
inkscape:version="1.0.1 (c497b03c, 2020-09-10)"><metadata
id="metadata122"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs120" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="861"
inkscape:window-height="790"
id="namedview118"
showgrid="false"
inkscape:zoom="1.7878788"
inkscape:cx="165"
inkscape:cy="165"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="0"
inkscape:current-layer="Layer_1" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:73.2664px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.83166"
x="83.402275"
y="106.78013"
id="text126"
transform="scale(0.82239993,1.2159534)"><tspan
sodipodi:role="line"
x="83.402275"
y="106.78013"
id="tspan128"
style="stroke-width:1.83166">FREQ</tspan><tspan
sodipodi:role="line"
x="83.402275"
y="198.36314"
id="tspan130"
style="stroke-width:1.83166">SHIFT</tspan></text></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

+74
View File
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 330 330"
style="enable-background:new 0 0 330 330;"
xml:space="preserve"
sodipodi:docname="unshift.svg"
inkscape:version="1.0.1 (c497b03c, 2020-09-10)"><metadata
id="metadata122"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs120" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="861"
inkscape:window-height="790"
id="namedview118"
showgrid="false"
inkscape:zoom="1.7878788"
inkscape:cx="165"
inkscape:cy="165"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="0"
inkscape:current-layer="Layer_1" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:73.2664px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.83166"
x="39.195156"
y="115.05988"
id="text126"
transform="scale(0.82239993,1.2159534)"><tspan
sodipodi:role="line"
x="39.195156"
y="115.05988"
id="tspan128"
style="stroke-width:1.83166"> FREQ</tspan><tspan
sodipodi:role="line"
x="39.195156"
y="206.64288"
id="tspan130"
style="stroke-width:1.83166">UNSHIFT</tspan></text></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

+90 -9
View File
@@ -100,6 +100,38 @@ if(isset($_GET['submit'])) {
}
}
if(isset($_GET["freqshift_hi"])) {
$freqshift_hi = $_GET["freqshift_hi"];
if(strcmp($freqshift_hi,$config['FREQSHIFT_HI']) !== 0) {
$contents = preg_replace("/FREQSHIFT_HI=.*/", "FREQSHIFT_HI=$freqshift_hi", $contents);
$contents2 = preg_replace("/FREQSHIFT_HI=.*/", "FREQSHIFT_HI=$freqshift_hi", $contents2);
}
}
if(isset($_GET["freqshift_lo"])) {
$freqshift_lo = $_GET["freqshift_lo"];
if(strcmp($freqshift_lo,$config['FREQSHIFT_LO']) !== 0) {
$contents = preg_replace("/FREQSHIFT_LO=.*/", "FREQSHIFT_LO=$freqshift_lo", $contents);
$contents2 = preg_replace("/FREQSHIFT_LO=.*/", "FREQSHIFT_LO=$freqshift_lo", $contents2);
}
}
if(isset($_GET["freqshift_pitch"])) {
$freqshift_pitch = $_GET["freqshift_pitch"];
if(strcmp($freqshift_pitch,$config['FREQSHIFT_PITCH']) !== 0) {
$contents = preg_replace("/FREQSHIFT_PITCH=.*/", "FREQSHIFT_PITCH=$freqshift_pitch", $contents);
$contents2 = preg_replace("/FREQSHIFT_PITCH=.*/", "FREQSHIFT_PITCH=$freqshift_pitch", $contents2);
}
}
if(isset($_GET["freqshift_tool"])) {
$freqshift_tool = $_GET["freqshift_tool"];
if(strcmp($freqshift_tool,$config['FREQSHIFT_TOOL']) !== 0) {
$contents = preg_replace("/FREQSHIFT_TOOL=.*/", "FREQSHIFT_TOOL=$freqshift_tool", $contents);
$contents2 = preg_replace("/FREQSHIFT_TOOL=.*/", "FREQSHIFT_TOOL=$freqshift_tool", $contents2);
}
}
if(isset($_GET["full_disk"])) {
$full_disk = $_GET["full_disk"];
if(strcmp($full_disk,$config['FULL_DISK']) !== 0) {
@@ -253,16 +285,65 @@ foreach($formats as $format){
<p>The BirdNET-Pi URL is how the main page will be reached. If you want your installation to respond to an IP address, place that here, but be sure to indicate "<i>http://</i>".<br>Example for IP: <i>http://192.168.0.109</i><br>Example if you own your own domain: <i>https://virginia.birdnetpi.com</i></p>
<label for="silence_update_indicator">Silence Update Indicator: </label>
<input type="checkbox" name="silence_update_indicator" <?php if($newconfig['SILENCE_UPDATE_INDICATOR'] == 1) { echo "checked"; };?> ><br>
<h3>BirdNET-Lite Settings</h3>
<label for="overlap">Overlap: </label>
<input name="overlap" type="number" min="0.0" max="2.9" step="0.1" value="<?php print($newconfig['OVERLAP']);?>" required/><br>
<p>Min=0.0, Max=2.9</p>
<label for="confidence">Minimum Confidence: </label>
<input name="confidence" type="number" min="0.01" max="0.99" step="0.01" value="<?php print($newconfig['CONFIDENCE']);?>" required/><br>
<p>Min=0.01, Max=0.99</p>
<label for="sensitivity">Sigmoid Sensitivity: </label>
<input name="sensitivity" type="number" min="0.5" max="1.5" step="0.01" value="<?php print($newconfig['SENSITIVITY']);?>" required/><br>
<p>Min=0.5, Max=1.5</p>
<p>
<label for="overlap">Overlap: </label>
<input name="overlap" type="number" min="0.0" max="2.9" step="0.1" value="<?php print($newconfig['OVERLAP']);?>" required/><br>
&nbsp;&nbsp;&nbsp;&nbsp;Min=0.0, Max=2.9
</p>
<p>
<label for="confidence">Minimum Confidence: </label>
<input name="confidence" type="number" min="0.01" max="0.99" step="0.01" value="<?php print($newconfig['CONFIDENCE']);?>" required/><br>
&nbsp;&nbsp;&nbsp;&nbsp;Min=0.01, Max=0.99
</p>
<p>
<label for="sensitivity">Sigmoid Sensitivity: </label>
<input name="sensitivity" type="number" min="0.5" max="1.5" step="0.01" value="<?php print($newconfig['SENSITIVITY']);?>" required/><br>
&nbsp;&nbsp;&nbsp;&nbsp;Min=0.5, Max=1.5
</p>
<h3>Accessibility Settings</h3>
<p>Birdsongs Frequency shifting configuration:<br>
this can be useful for earing impaired people.<br>
<p style="margin-left: 40px">
<label for="freqshift_tool">shifting tool: </label>
<select name="freqshift_tool">
<option selected="<?php print($newconfig['FREQSHIFT_TOOL']);?>"><?php print($newconfig['FREQSHIFT_TOOL']);?></option>
<?php
$formats = array("sox","ffmpeg");
$formats = array_diff($formats, array($newconfig['FREQSHIFT_TOOL']));
foreach($formats as $format){
echo "<option value='$format'>$format</option>";
}
?>
</select>
Choose here the shifting tool.<br>
</p>
<p style="margin-left: 40px">
using ffmpeg:
e.g. origin=6000, target=4000, performs a shift of 2000 Hz down.<br>
<label for="freqshift_hi">origin [Hz]: </label>
<input name="freqshift_hi" type="number" min="0" max="20000" step="1" value="<?php print($newconfig['FREQSHIFT_HI']);?>" required/><br>
<label for="freqshift_lo">target [Hz]: </label>
<input name="freqshift_lo" type="number" min="0" max="20000" step="1" value="<?php print($newconfig['FREQSHIFT_LO']);?>" required/>
</p>
<p style="margin-left: 40px">
using sox:
e.g. shiftPitch=-1200 performs a shift of 1 octave down. This value is in 100ths of a semitone.<br>
<label for="freqshift_pitch">pitch shift: </label>
<input name="freqshift_pitch" type="number" min="-4000" max="4000" step="1" value="<?php print($newconfig['FREQSHIFT_PITCH']);?>" required/><br>
</p>
</p>
<br><br>
<input type="hidden" name="view" value="Advanced">
<button onclick="if(<?php print($newconfig['PRIVACY_THRESHOLD']);?> != document.getElementById('privacy_threshold').value){return confirm('This will take about 90 seconds.')}" type="submit" name="submit" value="advanced">
+16 -2
View File
@@ -76,8 +76,6 @@ APPRISE_NOTIFICATION_BODY="A \$sciname \$comname was just detected with a confid
APPRISE_NOTIFY_EACH_DETECTION=0
APPRISE_NOTIFY_NEW_SPECIES=0
APPRISE_WEEKLY_REPORT=1
APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY=0
APPRISE_MINIMUM_SECONDS_BETWEEN_NOTIFICATIONS_PER_SPECIES=0
#---------------------- Flickr Images API Configuration -----------------------#
## If FLICKR_API_KEY is set, the web interface will try and display bird images
@@ -128,6 +126,22 @@ CONFIDENCE=0.7
SENSITIVITY=1.25
## Configuration of the frequency shifting feature, useful for earing impaired people.
## FREQSHIFT_TOOL
FREQSHIFT_TOOL=sox
## If the tool is ffmpeg, you have to define a freq. shift from HI to LO:
## FREQSHIFT_HI
FREQSHIFT_HI=6000
## FREQSHIFT_LO
FREQSHIFT_LO=3000
## If the tool is sox, you have to define the pitch shift (amount of 100ths of semintone)
## FREQSHIFT_PITCH
FREQSHIFT_PITCH=-1500
## CHANNELS holds the variable that corresponds to the number of channels the
## sound card supports.
+124 -8
View File
@@ -97,6 +97,45 @@ if(isset($_GET['excludefile'])) {
}
}
$shifted_path = $home."/BirdSongs/Extracted/By_Date/shifted/";
if(isset($_GET['shiftfile'])) {
$filename = $_GET['shiftfile'];
$pp = pathinfo($filename);
$dir = $pp['dirname'];
$fn = $pp['filename'];
$ext = $pp['extension'];
$pi = $home."/BirdSongs/Extracted/By_Date/";
if(isset($_GET['doshift'])) {
$freqshift_tool = $config['FREQSHIFT_TOOL'];
if ($freqshift_tool == "ffmpeg") {
$cmd = "/usr/bin/nohup /usr/bin/ffmpeg -y -i \"".$pi.$filename."\" -af \"rubberband=pitch=".$config['FREQSHIFT_LO']."/".$config['FREQSHIFT_HI']."\" \"".$shifted_path.$filename."\"";
shell_exec("mkdir -p ".$shifted_path.$dir." && echo \"".$cmd."\" > /tmp/shift.sh && chmod +x /tmp/shift.sh");
} else if ($freqshift_tool == "sox") {
//linux.die.net/man/1/sox
$soxopt = "-q";
$soxpitch = $config['FREQSHIFT_PITCH'];
$cmd = "/usr/bin/nohup /usr/bin/sox \"".$pi.$filename."\" \"".$shifted_path.$filename."\" pitch ".$soxopt." ".$soxpitch;
shell_exec("mkdir -p ".$shifted_path.$dir." && echo \"".$cmd."\" > /tmp/shift.sh && chmod +x /tmp/shift.sh");
}
shell_exec("/tmp/shift.sh");
shell_exec("rm -f /tmp/shift.sh");
} else {
$cmd = "rm -f " . $shifted_path.$filename;
shell_exec("echo \"".$cmd."\" > /tmp/unshift.sh && chmod +x /tmp/unshift.sh");
shell_exec("/tmp/unshift.sh");
shell_exec("rm -f /tmp/unshift.sh");
}
echo "OK";
die();
}
if(isset($_GET['bydate'])){
$statement = $db->prepare('SELECT DISTINCT(Date) FROM detections GROUP BY Date ORDER BY Date DESC');
if($statement == False){
@@ -208,6 +247,45 @@ function toggleLock(filename, type, elem) {
xhttp.open("GET", "play.php?excludefile="+filename+"&exclude_del=true", true);
}
xhttp.send();
elem.setAttribute("src","images/spinner.gif");
}
function toggleShiftFreq(filename, shiftAction, elem) {
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
if(this.responseText == "OK"){
if(shiftAction == "shift") {
elem.setAttribute("src","images/unshift.svg");
elem.setAttribute("title", "This file has been shifted down in frequency.");
elem.setAttribute("onclick", elem.getAttribute("onclick").replace("shift","unshift"));
console.log("shifted freqs of " + filename);
video=elem.parentNode.getElementsByTagName("video")[0];
video.setAttribute("title", video.getAttribute("title").replace("/By_Date/","/By_Date/shifted/"));
source = video.getElementsByTagName("source")[0];
source.setAttribute("src", source.getAttribute("src").replace("/By_Date/","/By_Date/shifted/"));
video.load();
} else {
elem.setAttribute("src","images/shift.svg");
elem.setAttribute("title", "This file is not shifted in frequency.");
elem.setAttribute("onclick", elem.getAttribute("onclick").replace("unshift","shift"));
console.log("unshifted freqs of " + filename);
video=elem.parentNode.getElementsByTagName("video")[0];
video.setAttribute("title", video.getAttribute("title").replace("/By_Date/shifted/","/By_Date/"));
source = video.getElementsByTagName("source")[0];
source.setAttribute("src", source.getAttribute("src").replace("/By_Date/shifted/","/By_Date/"));
video.load();
}
}
}
if(shiftAction == "shift") {
console.log("shifting freqs of " + filename);
xhttp.open("GET", "play.php?shiftfile="+filename+"&doshift=true", true);
} else {
console.log("unshifting freqs of " + filename);
xhttp.open("GET", "play.php?shiftfile="+filename, true);
}
xhttp.send();
elem.setAttribute("src","images/spinner.gif");
}
</script>
@@ -331,6 +409,8 @@ echo "<table>
$comname = preg_replace('/\'/', '', $comname);
$date = $results['Date'];
$filename = "/By_Date/".$date."/".$comname."/".$results['File_Name'];
$filename_shifted = "/By_Date/shifted/".$date."/".$comname."/".$results['File_Name'];
$filename_png = $filename . ".png";
$sciname = preg_replace('/ /', '_', $results['Sci_Name']);
$sci_name = $results['Sci_Name'];
$time = $results['Time'];
@@ -357,14 +437,31 @@ echo "<table>
$type = "del";
}
if(file_exists($shifted_path.$filename_formatted)) {
$shiftImageIcon = "images/unshift.svg";
$shiftTitle = "This file has been shifted down in frequency.";
$shiftAction = "unshift";
$filename = $filename_shifted;
} else {
$shiftImageIcon = "images/shift.svg";
$shiftTitle = "This file is not shifted in frequency.";
$shiftAction = "shift";
}
echo "<tr>
<td class=\"relative\"><img style='cursor:pointer;right:45px' src='images/delete.svg' onclick='deleteDetection(\"".$filename_formatted."\")' class=\"copyimage\" width=25 title='Delete Detection'> <img style='cursor:pointer' onclick='toggleLock(\"".$filename_formatted."\",\"".$type."\", this)' class=\"copyimage\" width=25 title=\"".$title."\" src=\"".$imageicon."\">$date $time<br>$confidence<br>
<video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster=\"$filename.png\" preload=\"none\" title=\"$filename\"><source src=\"$filename\"></video></td>
<td class=\"relative\">
<img style='cursor:pointer;right:90px' src='images/delete.svg' onclick='deleteDetection(\"".$filename_formatted."\")' class=\"copyimage\" width=25 title='Delete Detection'>
<img style='cursor:pointer;right:45px' onclick='toggleLock(\"".$filename_formatted."\",\"".$type."\", this)' class=\"copyimage\" width=25 title=\"".$title."\" src=\"".$imageicon."\">
<img style='cursor:pointer' onclick='toggleShiftFreq(\"".$filename_formatted."\",\"".$shiftAction."\", this)' class=\"copyimage\" width=25 title=\"".$shiftTitle."\" src=\"".$shiftImageIcon."\"> $date $time<br>$confidence<br>
<video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster=\"$filename_png\" preload=\"none\" title=\"$filename\"><source src=\"$filename\"></video></td>
</tr>";
} else {
echo "<tr>
<td class=\"relative\">$date $time<br>$confidence<img style='cursor:pointer' src='images/delete.svg' onclick='deleteDetection(\"".$filename_formatted."\")' class=\"copyimage\" width=25 title='Delete Detection'><br>
<video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster=\"$filename.png\" preload=\"none\" title=\"$filename\"><source src=\"$filename\"></video></td>
<td class=\"relative\">$date $time<br>$confidence
<img style='cursor:pointer' src='images/delete.svg' onclick='deleteDetection(\"".$filename_formatted."\")' class=\"copyimage\" width=25 title='Delete Detection'><br>
<video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster=\"$filename_png\" preload=\"none\" title=\"$filename\"><source src=\"$filename\"></video></td>
</tr>";
}
@@ -388,6 +485,8 @@ echo "<table>
$comname = preg_replace('/\'/', '', $comname);
$date = $results['Date'];
$filename = "/By_Date/".$date."/".$comname."/".$results['File_Name'];
$filename_shifted = "/By_Date/shifted/".$date."/".$comname."/".$results['File_Name'];
$filename_png = $filename . ".png";
$sciname = preg_replace('/ /', '_', $results['Sci_Name']);
$sci_name = $results['Sci_Name'];
$time = $results['Time'];
@@ -411,14 +510,31 @@ echo "<table>
$type = "del";
}
if(file_exists($shifted_path.$filename_formatted)) {
$shiftImageIcon = "images/unshift.svg";
$shiftTitle = "This file has been shifted down in frequency.";
$shiftAction = "unshift";
$filename = $filename_shifted;
} else {
$shiftImageIcon = "images/shift.svg";
$shiftTitle = "This file is not shifted in frequency.";
$shiftAction = "shift";
}
echo "<tr>
<td class=\"relative\"><img style='cursor:pointer;right:45px' src='images/delete.svg' onclick='deleteDetection(\"".$filename_formatted."\", true)' class=\"copyimage\" width=25 title='Delete Detection'> <img style='cursor:pointer' onclick='toggleLock(\"".$filename_formatted."\",\"".$type."\", this)' class=\"copyimage\" width=25 title=\"".$title."\" src=\"".$imageicon."\">$date $time<br>$confidence<br>
<video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster=\"$filename.png\" preload=\"none\" title=\"$filename\"><source src=\"$filename\"></video></td>
<td class=\"relative\">
<img style='cursor:pointer;right:90px' src='images/delete.svg' onclick='deleteDetection(\"".$filename_formatted."\", true)' class=\"copyimage\" width=25 title='Delete Detection'>
<img style='cursor:pointer;right:45px' onclick='toggleLock(\"".$filename_formatted."\",\"".$type."\", this)' class=\"copyimage\" width=25 title=\"".$title."\" src=\"".$imageicon."\">
<img style='cursor:pointer' onclick='toggleShiftFreq(\"".$filename_formatted."\",\"".$shiftAction."\", this)' class=\"copyimage\" width=25 title=\"".$shiftTitle."\" src=\"".$shiftImageIcon."\">$date $time<br>$confidence<br>
<video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster=\"$filename_png\" preload=\"none\" title=\"$filename\"><source src=\"$filename\"></video></td>
</tr>";
} else {
echo "<tr>
<td class=\"relative\">$date $time<br>$confidence<img style='cursor:pointer' src='images/delete.svg' onclick='deleteDetection(\"".$filename_formatted."\", true)' class=\"copyimage\" width=25 title='Delete Detection'><br>
<video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster=\"$filename.png\" preload=\"none\" title=\"$filename\"><source src=\"$filename\"></video></td>
<td class=\"relative\">$date $time<br>$confidence
<img style='cursor:pointer' src='images/delete.svg' onclick='deleteDetection(\"".$filename_formatted."\", true)' class=\"copyimage\" width=25 title='Delete Detection'><br>
<video onplay='setLiveStreamVolume(0)' onended='setLiveStreamVolume(1)' onpause='setLiveStreamVolume(1)' controls poster=\"$filename_png\" preload=\"none\" title=\"$filename\"><source src=\"$filename\"></video></td>
</tr>";
}
+13
View File
@@ -123,5 +123,18 @@ fi
sudo sed -i 's|<!-- <bind-address>.*|<bind-address>127.0.0.1</bind-address>|;s|<!-- <shoutcast-mount>.*|<shoutcast-mount>/stream</shoutcast-mount>|' /etc/icecast2/icecast.xml
sudo systemctl restart icecast2
if ! grep FREQSHIFT_TOOL /etc/birdnet/birdnet.conf &>/dev/null;then
sudo -u$USER echo "FREQSHIFT_TOOL=sox" >> /etc/birdnet/birdnet.conf
fi
if ! grep FREQSHIFT_HI /etc/birdnet/birdnet.conf &>/dev/null;then
sudo -u$USER echo "FREQSHIFT_HI=6000" >> /etc/birdnet/birdnet.conf
fi
if ! grep FREQSHIFT_LO /etc/birdnet/birdnet.conf &>/dev/null;then
sudo -u$USER echo "FREQSHIFT_LO=3000" >> /etc/birdnet/birdnet.conf
fi
if ! grep FREQSHIFT_PITCH /etc/birdnet/birdnet.conf &>/dev/null;then
sudo -u$USER echo "FREQSHIFT_PITCH=-1500" >> /etc/birdnet/birdnet.conf
fi
sudo systemctl daemon-reload
restart_services.sh