About

This is a test to see if JS could loop locally sourced, organic, free-range, non-GMO mp3 files.  This is done entirely in the browser.
You have to

  1. upload the file or files in the input below,
  2. click "Load File" to ingest it/them into the browser's memory,
  3. specify the index of the file you want to play,
  4. then click "Load" at the bottom to update the audio player.

If for some reason you actually used this and you want to remove a file, type the file name into the file clearer box for it to be removed from the files object and current file list.
About indices:
Normal index
A number (like 2 or 3) will load the file at that index (corresponding to its name in the list on the right) for playback. Indices start at 0.
Random index
Typing random (or r, rand, rnd) will load a random file (choosing one each time playback finishes). This cannot be combined with array indices
Array index
Giving an "index" of the form [0,1,2:2,3] will play sequentially through those indices. If an index is optionally followed with a colon and a number (without spaces around the colon), the file will be played that many times before moving to the next one.
By default, playback stops after the end of the array (list) is reached, unless "Restart array playback after the last item of array index" (below) is checked.  If there is a number after the array (after the closing square bracket, such as in [0,3,4,2]2), the array will play that many times before stopping.  Array indices are limited to 1,000 index changes, but that does not apply to repetition from a number at the end.
Array generator
An "index" of f, >, b, <, r, #, s, or @ (optionally followed by a number, such as in f3) will transform into an array of all file indices depending on the first character.
First character Order through files
f or > Ascending
b or < Descending
r or # Shuffled randomly*
s or @ Shuffled piecewise**

*Shuffled randomly: "Clones" from a number in the generator are all shuffled together; using r2 with 4 files, [1,2,1,3,0,3,0,2] is a possible result.
**Shuffled piecewise: Each set of "clones" is shuffled individually; using s2 with 3 files, [0,2,1,1,0,2] is a possible result, but [2,1,1,0,2,0] is not.

For instance, if you have 4 files loaded and type b2, it will become [3,2,1,0,3,2,1,0]. The resulting arrays are subject to the 1,000-change limit for arrays.

Other

If the first bit of the audio is cut off *cough Safari, particularly noticeable with shorter sounds*, try checking the "Reload file on next play" checkbox (though this will be slow on larger files).
Play numbers refer to completed plays, where the playback is allowed to reach the end of the file.
The "Reset tracking variables" button (asks for confirmation) should save the current session timing and play data to localStorage, then reset said data in memory to null, if you want to do it. It should not remove the loaded files.

Main controls

No file loader status



No file remover status



No loader status

No index setter status

Which index? (0 = first file)  

Reload file on next play?
Avoid repeating files when using random index?
Do not loop?
Restart array playback after its last item?


Backup controls:
No file



Play counter

No files loaded / played

Currently loaded files

    No files loaded

No file list warper status



Storing 0 characters of base64
(not including file currently loaded to audio tag)

Local storage

I'm sick of losing data

    No keys in localStorage

No localStorage downloader status

Which index to download JSON of?

go to main page