Skip to content

Instantly share code, notes, and snippets.

@RealityRipple
Last active May 26, 2024 20:54
Show Gist options
  • Save RealityRipple/adb072b02c560690421f4e3db6443a89 to your computer and use it in GitHub Desktop.
Save RealityRipple/adb072b02c560690421f4e3db6443a89 to your computer and use it in GitHub Desktop.
JSON Playlist File Definition
{
"Title": "Example JavaScript Object Notation Playlist File",
"Time": "00:00:10:25.845",
"Tracks":
[
{
"Title": "Track 1",
"Artist": "The Band",
"Album": "The Record",
"Time": "02:15.600",
"Path": "M:\\Music\\The Band\\The Record\\01 Track 1.wav"
},
[
{
"Title": "Track 2",
"Artist": "The Band",
"Album": "The Record",
"Time": "30",
"Path": "M:\\Music\\The Band\\The Record\\02 Track 2.wav"
},
{
"Title": "Track 3",
"Artist": "The Band",
"Album": "The Record",
"Time": "1:40",
"Path": "M:\\Music\\The Band\\The Record\\03 Track 3.wav"
}
],
{
"Title": "Track 4",
"Artist": "The Band",
"Album": "The Record",
"Time": "6:00.225",
"Path": "M:\\Music\\The Band\\The Record\\04 Track 4.wav"
},
{
"Title": "Untitled Bonus Track",
"Artist": "The Band",
"Album": "The Record",
"Time": "0.020",
"Path": "http://theband.music/The-Record/Track05.wav"
}
],
"Shuffle": "never",
"Repeat": "no"
}

JOPL File Notes

Written by Andrew Sachen (2018-2024)

Share and Enjoy (Public Domain)

The JSON Playlist file format is designed to be dynamic but restrictive. UTF-8 is encouraged, I guess. Its major advantage over M3U and PLS file formats is the idea of contiguous files. It also benefits from the ability to include multiple attributes, including proprietary ones. And it's JSON, so it's simple.

File Extensions

*.jop, *.jopl, *.jop8

  • *.jop should not cointain whitespace, but it can if it wants to.
  • *.jop8 must be in UTF-8. *.jop and *.jopl can be in UTF-8 if they want to be, too.

Elements and Objects

  • Element properties are all strings. Even numbers are strings. Especially numbers.
  • Title, Time and Tracks must all be present in the Root object.
  • Time elements should be delimited as DD:HH:MM:SS.TTT or less.
    • Colons must delimit days, hours, minutes, and seconds. Milliseconds must be separated by a period.
    • At least one S must always be present, even if it's just a 0.
      • "0" means unknown.
    • If one T is present, T00 must be present.
      • 0.1 must be written "0.100".
    • If one M is present, 0S must be present, and so forth up to 0H for D.
      • "1:05:02" is the shortest way of expressing one hour, five minutes, and two seconds.
    • "1:00:00:00.000" is exactly 86,400,000 milliseconds.
    • Values must never be negative under any circumstances.
    • I've tried to include all relevant possible examples in the definition.
  • Tracks is an array of "Track" objects. (The name "Track" is not used in the definition)
    • If a Track is an array instead of an object, the array is of Track objects.
      • Track arrays must not be shuffled if the Playlist is shuffled. They are to be considered contiguous at all relevant times.
      • NOTE: Contiguous does not mean merged. They are separate files that will always be played in the order listed.
    • Track objects must contain a Path element at least. They should also contain a Title and Time element.
    • The Path element should be a valid local file system path or a remote location over HTTP, HTTPS, or FTP.
      • The Path element may also be over any other protocol, standardized, custom, or otherwise.
        • Unsupported protocols should be passively remarked upon when the Playlist is loaded by a program, and their associated Track skipped.
  • Shuffle is an optional directive to describe the Playlist's intended order. Valid possibilities are:
    • "always" means the order in the Playlist is arbitrary. Shuffling the Playlist by default is recommended.
      • Example: A singles collection or a custom Playlist.
    • "yes" means the order in the Playlist may have meaning, but is not vital. (Default)
      • Example: A normal album or discorgaphy by most musicians.
    • "no" means the order in the Playlist is important to the content. Shuffling may be discouraged.
      • Example: A concept album, classical piece with independent movements, or TV serialization.
    • "never" means the order of the Playlist is vital. Shuffling should be disabled, if possible.
      • Example: An audiobook split into chapters or a TV miniseries.
  • Repeat is an optional directive to make the Playlist play on a loop. Valid possibilities are:
    • "always" means the Playlist should never stop when it reaches the final Track object, if supported. This may mean returning to the beginning of the first Track object, or selecting another Track objectaccording to a shuffling algorithm.
      • Example: An album or series that has a cyclical nature or plot, in which the end directly references the beginning.
    • "yes" means the Playlist is assembled with the intention to be looped or to play more than once through.
      • Example: A collection for use as background music to continue for an undetermined period of time.
    • "no" means that the Playlist could be looped at the user's choice, but that repeat listenings are not intended. (Default)
      • Example: Any typical Playlist.
    • "never" means that the Playlist should always stop after the final Track object.
      • Example: Any standard narrative, such as an audiobook or plot-linked video collection.
  • Additional proprietary elements may be included in the Root or in a Track object.
    • They should not be read by software except when specifically required for proprietary reasons.
    • Consider all unlisted elements as Comments.
    • Such elements could, for example, include:
      • Year in a Track object.
      • Artist or Album in the Root object for specific albums or artist favorites.
      • Artwork in the Root or a Track object. May either be in the format of Path or as a base64 encoded string. Should be JPG or PNG.
      • Modified in the Root object to say when the Playlist was last changed.
    • These elements are not endorsed by the definition, they are merely examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment