<p>.wav, .mp3, .vorbis, .ogg, .aif</p>
<p style="padding: 5px; color: green; border: 1.5px solid green;">
Note from will:<br>
- Just waiting on some idents from Jeremy, will hopefully give some more variety in the idents that can be picked! I'll also be building in .mp3 support soon...<br>
+ Just waiting on some idents from Jeremy, will hopefully give some more variety in the idents that can be picked!<br>
Also if anything goes wrong pls let me know asap!
</p>
<form action="./index.php" method="post" enctype="multipart/form-data">
<fieldset>
<legend>Front ident</legend>
- <input type="radio" name="frontId" id="frontId" value="assets/front_news.wav" checked="checked"/>
- <label for="frontId">Utter news generic</label>
+ <input type="radio" name="frontId" id="frontId" value="weather_in" checked="checked"/>
+ <label for="frontId">Weather front ident</label><br>
+ <audio controls src="assets/weather_in.wav"></audio><br>
</fieldset>
<fieldset>
<legend>Bed</legend>
- <input type="radio" name="bed" id="bed" value="assets/bed_news.wav" checked="checked"/>
- <label for="bed">Utter news generic</label>
+ <input type="radio" name="bedId" id="bedId" value="energetic_bed" checked="checked"/>
+ <label for="bedId">Energetic bed</label><br>
+ <audio controls src="assets/energetic_bed.wav"></audio><br>
+ <input type="radio" name="bedId" id="bedId" value="weather_bed" checked="checked"/>
+ <label for="bedId">Weather bed</label><br>
+ <audio controls src="assets/weather_bed.wav"></audio><br>
+ <input type="radio" name="bedId" id="bedId" value="mystery_bed" checked="checked"/>
+ <label for="bedId">Mystery bed</label><br>
+ <audio controls src="assets/mystery_bed.wav"></audio><br>
+ <input type="radio" name="bedId" id="bedId" value="generic_bed" checked="checked"/>
+ <label for="bedId">Utter news generic</label><br>
+ <audio controls src="assets/generic_bed.wav"></audio><br>
</fieldset>
<fieldset>
<legend>Back ident</legend>
- <input type="radio" name="backId" id="backId" value="assets/back_news.wav" checked="checked"/>
- <label for="backId">Utter news generic</label>
+ <input type="radio" name="backId" id="backId" value="generic_out" checked="checked"/>
+ <label for="backId">Utter news generic</label><br>
+ <audio controls src="assets/generic_out.wav"></audio><br>
</fieldset>
<br><label for="file">Select a file (.wav)</label>
<br><input type="file" id="file" name="file"/>
<br><br><input type="submit" name="upload" value="upload"/>
<br><br><output>
<?php
-# error_reporting(E_ALL);
-# ini_set('display_errors', 'On');
+error_reporting(E_ALL);
+ini_set('display_errors', 'On');
if (!empty($_POST['upload'])) {
echo "Uploading...<br>";
$output=null;
$retval=null;
- exec("./script.sh", $output, $retval);
+ exec("./script.sh -i $frontId -b $bedId -o $backId", $output, $retval);
$output = var_export($output, true);
if ($retval == "0") {
echo "<span class='green'>Finished processing successfully.</span><br><br>";
echo "<audio controls src='assets/news.wav' />";
+ } else {
+ echo "<span class='utter'>Error! (code $retval)<br>$output</span>";
}
} else {
echo "<span class='utter'>Sorry, there was an error uploading your file.</span>";
+POSITIONAL_ARGS=()
+
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ -i|--in-ident)
+ IN_IDENT="$2"
+ shift # past argument
+ shift # past value
+ ;;
+ -b|--bed)
+ BED="$2"
+ shift # past argument
+ shift # past value
+ ;;
+ -o|--out-ident)
+ OUT_IDENT="$2"
+ shift # past argument
+ shift # past value
+ ;;
+ -*|--*)
+ echo "Unknown option $1"
+ exit 1
+ ;;
+ *)
+ POSITIONAL_ARGS+=("$1") # save positional arg
+ shift # past argument
+ ;;
+ esac
+done
+
sox assets/upload.wav -c 1 -r 48k assets/temp.wav \
norm -3 \
silence -l 1 0.1 1% -1 2.0 1% \
length=$((length + padding))
sox assets/temp.wav assets/vox.wav pad "$fadein"s 0
-sox assets/bed_news.wav assets/temp.wav \
+sox assets/"$BED".wav assets/temp.wav \
trim 0s "$length"s \
fade 0 -0 "$fadeout"s
-sox assets/front_news.wav "|sox -M assets/vox.wav assets/temp.wav -c 1 -t sox -" assets/back_news.wav assets/news.mp3 norm -3
+sox assets/"$IN_IDENT".wav "|sox -M assets/vox.wav assets/temp.wav -c 1 -t sox -" assets/"$OUT_IDENT".wav assets/news.mp3 norm -3
exit 0