Skip to content

Commit

Permalink
removed duration field from JSON - not used
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalcolony committed Nov 22, 2018
1 parent 89d7d56 commit 71d1250
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
14 changes: 9 additions & 5 deletions README.md
Expand Up @@ -25,13 +25,11 @@ The Soundboard JSON file is a collection of files. Each file will have a name, d
"files": [
{
"name": "1 to 12 hour - Boca Britany Somers",
"duration": "0:00:03",
"mp3":
"/sounds/1-to-12-hour.mp3"
},
{
"name": "2 of the Dumbest White Men - Mike Reineri",
"duration": "0:00:07",
"mp3":
"/sounds/2-of-the-Dumbest-White-Men.mp3"
}
Expand All @@ -45,7 +43,7 @@ You can create the JSON file a few different ways.

1. By hand. With any editor, you can type up your own JSON file that describes your Soundboard. This is perfect if where you want to host the Soundboard does not support server-side code.
1. With PHP. Included in this repo is PHP code that will build the JSON file for you. PHP is widely supported with web hosts.
1. NodeJS. (future development)
1. NodeJS. The filename version is now completed. The ID3 version is yet to be coded.

## Building the JSON with PHP

Expand All @@ -54,7 +52,13 @@ There are 2 ways to build the JSON file using PHP.
1. Filename: If you want the buttons to draw their names using the filename, use the **buildJSON_filename.php** page for your Simple Soundboard. To display a ? on the button use [Q] in the file name. Example: **why[Q].mp3**.
1. ID3: If your MP3 files have Titles defined in the ID3 tags, you will want to use the **buildJSON_id3.php** page for your Simple Soundboard. The code will draw the buttons on the soundboard using the getID3 library to read the title and artist. The ID3 title will be used for the button text and the artist will be used for a tooltip on mouseover.

The ID3 version is the better version to use. If you need a tool to help you edit the ID3 tags of your MP3 files so they all have titles, look into [Mp3Tag](https://www.mp3tag.de/en/). Artist is optional. Drops without an artist will not have a tooltip.
The ID3 version is the better version to use. If you need a tool to help you edit the ID3 tags of your MP3 files so they all have titles, look into [Mp3Tag](https://www.mp3tag.de/en/). Artist is optional. Drops without an artist will not have a tooltip.

## Building the JSON with NodeJS

1. Filename: If you want the buttons to draw their names using the filename, use the **json_filename.js** page for your Simple Soundboard. To display a ? on the button use [Q] in the file name. Example: **why[Q].mp3**. From the node/ folder run node json_filename.js.

1. ID3: Not coded yet.

## Some Ideas For Your Soundboard

Expand All @@ -73,6 +77,6 @@ This is the [Neil Rogers Soundboard](https://neilrogers.org/soundboard/) built u

## Future Development

1. Create Node.JS version
1. Create Node.JS ID3 version

1. Move JQuery to Vanilla JS
2 changes: 1 addition & 1 deletion inc/json/soundboard.json
@@ -1 +1 @@
{"files":[{"name":"Ayayayayayayayay!","artist":"","mp3":"../sounds/Ayayayayayayayay!.mp3"},{"name":"Constipated","artist":"","mp3":"../sounds/Constipated.mp3"},{"name":"Do do do do","artist":"","mp3":"../sounds/Do-do-do-do.mp3"},{"name":"Floridians Dumb as dirt","artist":"","mp3":"../sounds/Floridians-Dumb-as-dirt.mp3"},{"name":"Frosty Nads?","artist":"","mp3":"../sounds/Frosty-Nads[Q].mp3"},{"name":"Happy Birthday","artist":"","mp3":"../sounds/Happy-Birthday.mp3"},{"name":"Happy Purim","artist":"","mp3":"../sounds/Happy-Purim.mp3"},{"name":"I Don't Believe It","artist":"","mp3":"../sounds/I-Don't-Believe-It.mp3"},{"name":"Idiotic jerk","artist":"","mp3":"../sounds/Idiotic-jerk.mp3"},{"name":"Laugh Bird","artist":"","mp3":"../sounds/Laugh-Bird.mp3"},{"name":"Laugh Brooke","artist":"","mp3":"../sounds/Laugh-Brooke.mp3"},{"name":"Laugh Gilbert","artist":"","mp3":"../sounds/Laugh-Gilbert.mp3"},{"name":"Laugh Goofy","artist":"","mp3":"../sounds/Laugh-Goofy.mp3"},{"name":"Laugh Montage","artist":"","mp3":"../sounds/Laugh-Montage.mp3"},{"name":"Loan me 50 Dollars","artist":"","mp3":"../sounds/Loan-me-50-Dollars.mp3"},{"name":"No","artist":"","mp3":"../sounds/No.mp3"},{"name":"Only in the Banana Republic","artist":"","mp3":"../sounds/Only-in-the-Banana-Republic.mp3"},{"name":"Ya mon!","artist":"","mp3":"../sounds/Ya-mon!.mp3"},{"name":"Yank it baby","artist":"","mp3":"../sounds/Yank-it-baby.mp3"},{"name":"Yeeeeeeesss","artist":"","mp3":"../sounds/Yeeeeeeesss.mp3"}]}
{"files":[{"name":"Ayayayayayayayay!","artist":"","mp3":"\/sounds\/Ayayayayayayayay!.mp3"},{"name":"Bird laugh","artist":"Glen Hill","mp3":"\/sounds\/Laugh-Bird.mp3"},{"name":"Do do do do","artist":"","mp3":"\/sounds\/Do-do-do-do.mp3"},{"name":"Floridians dumb as dirt","artist":"Jennifer Rehm","mp3":"\/sounds\/Floridians-Dumb-as-dirt.mp3"},{"name":"Frosty Nads","artist":"Jennifer Rehm","mp3":"\/sounds\/Frosty-Nads[Q].mp3"},{"name":"Happy Birthday","artist":"","mp3":"\/sounds\/Happy-Birthday.mp3"},{"name":"Happy Purim","artist":"Thanks for Calling Lady","mp3":"\/sounds\/Happy-Purim.mp3"},{"name":"I Don't Believe It","artist":"Jim Mandich","mp3":"\/sounds\/I-Don't-Believe-It.mp3"},{"name":"I Don't Do my Job as Well When I'm Constipated","artist":"","mp3":"\/sounds\/Constipated.mp3"},{"name":"Idiotic jerk","artist":"Old Boat Dude","mp3":"\/sounds\/Idiotic-jerk.mp3"},{"name":"Laugh Brooke","artist":"Brooke Daniels","mp3":"\/sounds\/Laugh-Brooke.mp3"},{"name":"Laugh Gilbert","artist":"Gilbert Solomon","mp3":"\/sounds\/Laugh-Gilbert.mp3"},{"name":"Laugh Goofy","artist":"","mp3":"\/sounds\/Laugh-Goofy.mp3"},{"name":"Laugh Montage","artist":"Gilbert\/Brooke Daniels","mp3":"\/sounds\/Laugh-Montage.mp3"},{"name":"Loan me 50 Dollars","artist":"Larry King","mp3":"\/sounds\/Loan-me-50-Dollars.mp3"},{"name":"No","artist":"Drew Michaels","mp3":"\/sounds\/No.mp3"},{"name":"Only in the Banana Republic","artist":"Jim Mandich","mp3":"\/sounds\/Only-in-the-Banana-Republic.mp3"},{"name":"Ya mon!","artist":"","mp3":"\/sounds\/Ya-mon!.mp3"},{"name":"Yank it baby","artist":"Jennifer Rehm","mp3":"\/sounds\/Yank-it-baby.mp3"},{"name":"Yeeeeeeesss","artist":"Jim Mandich","mp3":"\/sounds\/Yeeeeeeesss.mp3"}]}
2 changes: 0 additions & 2 deletions php/buildJSON_filename.php
Expand Up @@ -20,15 +20,13 @@
$file_title = str_replace("[Q]","?", $file_title);
$file_title = str_replace("-"," ", $file_title);
$file_artist = "";
$duration = "";

$file_name = $mp3directory . $fileinfo->getFilename();
// Remove .. from path for Soundboard loading
$file_name = str_replace("../","/", $file_name);

$sounds[] = array('name'=> $file_title,
'artist'=> $file_artist,
'duration'=> $duration,
'mp3'=> $file_name);
}
}
Expand Down
4 changes: 1 addition & 3 deletions php/buildJSON_id3.php
Expand Up @@ -25,7 +25,6 @@
// Not sure why, but getting a double quote to display right required a double decode.
$file_title = html_entity_decode(html_entity_decode($file_title));
$file_artist = html_entity_decode(html_entity_decode($file_artist));
$playtime = $id3_info["playtime_string"];
$file_name = $mp3directory . $fileinfo->getFilename();
// Remove .. from path for Soundboard loading
$file_name = str_replace("../","/", $file_name);
Expand All @@ -35,7 +34,6 @@

$sounds[] = array('name'=> $file_title,
'artist'=> $file_artist,
'duration'=> $playtime,
'mp3'=> $file_name);
}
}
Expand Down Expand Up @@ -67,6 +65,6 @@
<p>Simple Soundboard JSON Built successfully!</p>
<p>Visit your <a href="<?php echo($configs->SOUNDBOARD_PAGE) ?>">Soundboard</a>.</p>


<p></p>
</body>
</html>

0 comments on commit 71d1250

Please sign in to comment.