Skip to content

A live bird collage card for your Home Assistant dashboard.

Added config parameters for frequency shift feature

Louis Croisez88a9b6345857
diff --git a/birdnet.conf-defaults b/birdnet.conf-defaults
index 6eb87b68..a3dab576 100644
--- a/birdnet.conf-defaults
+++ b/birdnet.conf-defaults
@@ -115,6 +115,16 @@ CONFIDENCE=0.7
SENSITIVITY=1.25
+## Configuration of the frequency shifting feature, useful for earing impaired people.
+## You have to define a freq. shift from HI to LO:
+## FREQSHIFT_HI
+
+FREQSHIFT_HI=6000
+
+## FREQSHIFT_LO
+
+FREQSHIFT_LO=3000
+
## CHANNELS holds the variable that corresponds to the number of channels the
## sound card supports.
diff --git a/scripts/advanced.php b/scripts/advanced.php
index d2cdfe77..13631c5d 100644
--- a/scripts/advanced.php
+++ b/scripts/advanced.php
@@ -253,16 +253,35 @@ 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>
+ &nbsp;&nbsp;&nbsp;&nbsp;this can be useful for earing impaired people.<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;e.g. origin=6000, target=4000, performs a shift of 2000 Hz down.<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<label for="hifreqshift">origin [Hz]: </label>
+ <input name="hifreqshift" type="number" min="0" max="20000" step="1" value="<?php print($newconfig['FREQSHIFT_HI']);?>" required/><br>
+ &nbsp;&nbsp;&nbsp;&nbsp;<label for="lofreqshift">target [Hz]: </label>
+ <input name="lofreqshift" type="number" min="0" max="20000" step="1" value="<?php print($newconfig['FREQSHIFT_LO']);?>" required/><br>
+ </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">
diff --git a/scripts/install_config.sh b/scripts/install_config.sh
index a7f79915..da5f6fb1 100755
--- a/scripts/install_config.sh
+++ b/scripts/install_config.sh
@@ -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,16 @@ CONFIDENCE=0.7
SENSITIVITY=1.25
+## Configuration of the frequency shifting feature, useful for earing impaired people.
+## You have to define a freq. shift from HI to LO:
+## FREQSHIFT_HI
+
+FREQSHIFT_HI=6000
+
+## FREQSHIFT_LO
+
+FREQSHIFT_LO=3000
+
## CHANNELS holds the variable that corresponds to the number of channels the
## sound card supports.
diff --git a/scripts/play.php b/scripts/play.php
index 01436320..020a342a 100644
--- a/scripts/play.php
+++ b/scripts/play.php
@@ -107,7 +107,7 @@ if(isset($_GET['shiftfile'])) {
$fn = $pp['filename'];
$ext = $pp['extension'];
$pi = $home."/BirdSongs/Extracted/By_Date/";
- $cmd = "/usr/bin/nohup /usr/bin/ffmpeg -y -i \"".$pi.$filename."\" -af \"rubberband=pitch=2500/6000\" \"".$shifted_path.$filename."\"";
+ $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");
shell_exec("/tmp/shift.sh");
shell_exec("rm -f /tmp/shift.sh");