From: will Date: Fri, 20 Sep 2024 21:38:34 +0000 (+0100) Subject: Fixed output to mp3 and added "currently airing" X-Git-Url: https://git.ozva.co.uk/?a=commitdiff_plain;h=c23ea0a8f642b45f6bd0cdfb086cd7a6e9166b8c;p=utter-news Fixed output to mp3 and added "currently airing" --- diff --git a/index.php b/index.php index 054cdf8..f464bed 100644 --- a/index.php +++ b/index.php @@ -1,101 +1,103 @@ - - - - - -

Utter news authenticated upload

-

Next airtime: Loading...

-

Welcome to the Utter News upload page.

-

Here you will upload your recorded news to the playout system, automatically scheduling it.

-

Guide

-
    -
  1. Record your news voice over, make sure to do this somewhere as quiet as possible. This can even be done on your phone. Don't worry about leaving long pauses, the proccessing system will remove these automatically!
  2. -
  3. Pick your intro jingle, outro jingle and bed.
  4. -
  5. Upload the file from your device or recorder.
  6. -
  7. Click submit and it's done!'
  8. -
  9. Your news will playout at the next top-of-the-hour oppertunity*.
  10. -
-

*Note that between 22:00 and 02:00, this will be replaced by Spaceweather.

-

Supported file types

-

.wav, .mp3, .vorbis, .ogg, .aif

-

- Note from will:
- 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...
- Also if anything goes wrong pls let me know asap! -

-
-
- Front ident - - -
+ + + +

Utter news authenticated upload

+

Next airtime: Loading...

+

Currently airing:

+

+

Welcome to the Utter News upload page.

+

Here you will upload your recorded news to the playout system, automatically scheduling it.

+

Guide

+
    +
  1. Record your news voice over, make sure to do this somewhere as quiet as possible. This can even be done on your phone. Don't worry about leaving long pauses, the proccessing system will remove these automatically!
  2. +
  3. Pick your intro jingle, outro jingle and bed.
  4. +
  5. Upload the file from your device or recorder.
  6. +
  7. Click submit and it's done!'
  8. +
  9. Your news will playout at the next top-of-the-hour oppertunity*.
  10. +
+

*Note that between 22:00 and 02:00, this will be replaced by Spaceweather.

+

Supported file types

+

.wav, .mp3, .vorbis, .ogg, .aif

+

+ Note from will:
+ 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...
+ Also if anything goes wrong pls let me know asap! +

+ +
+ Front ident + + +
-
- Bed - - -
+
+ Bed + + +
-
- Back ident - - -
-
-
-

-

+
+ Back ident + + +
+
+
+

+

"; + echo "Uploading...
"; - $fileType = strtolower(pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION)); - $targetFile = "assets/upload." . $fileType; - $uploadOk = true; + $fileType = strtolower(pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION)); + $targetFile = "assets/upload." . $fileType; + $uploadOk = true; - # remove the . to prevent sandbox escape - $frontId = str_replace(".", "", $_POST["frontId"]); - $bedId = str_replace(".", "", $_POST["bedId"]); - $backId = str_replace(".", "", $_POST["backId"]); + # remove the . to prevent sandbox escape + $frontId = str_replace(".", "", $_POST["frontId"]); + $bedId = str_replace(".", "", $_POST["bedId"]); + $backId = str_replace(".", "", $_POST["backId"]); - if($fileType != "wav" && $fileType != "mp3" && $fileType != "ogg" && $fileType != "vorbis" && $fileType != "aif") { - echo "Only .wav and .mp3 files are currently allowed.
"; - $uploadOk = false; - } + if($fileType != "wav" && $fileType != "mp3" && $fileType != "ogg" && $fileType != "vorbis" && $fileType != "aif") { + echo "Only .wav and .mp3 files are currently allowed.
"; + $uploadOk = false; + } - if (move_uploaded_file($_FILES["file"]["tmp_name"], $targetFile) and $uploadOk) { - echo "File successfully uploaded!
Processing...
"; + if (move_uploaded_file($_FILES["file"]["tmp_name"], $targetFile) and $uploadOk) { + echo "File successfully uploaded!
Processing...
"; - # convert to wav if not already - if ($fileType != "wav") { - exec("sox assets/upload.$fileType assets/upload.wav"); - } + # convert to wav if not already + if ($fileType != "wav") { + exec("sox assets/upload.$fileType assets/upload.wav"); + } - $output=null; - $retval=null; - exec("./script.sh", $output, $retval); - $output = var_export($output, true); - if ($retval == "0") { - echo "Finished processing successfully.

"; - echo "
- - +
+ + diff --git a/script.sh b/script.sh index ff226f8..8dcb700 100755 --- a/script.sh +++ b/script.sh @@ -15,6 +15,6 @@ sox assets/bed_news.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.wav norm -3 +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 exit 0