Dropcloud is a web music player which uses Dropbox as a file database. A lot of musicians back up and store their audio files on Dropbox. Myself and my friends included.
Lots of musicians even store their work-in-progress tracks or short audio snippets. The most popular website for such usage is SoundCloud, but unfortunately they only offer 180 minutes of free storage. Beyond that, users need a monthly subscription.
The idea behind Dropcloud is to provide a modern UI for browsing your music files and also act as a music player. It also comes with a customizable audio visualizer.
File Explorer
Dropbox returns a flat array of files. It is up to the client to create the folder structure. After some recursive formatting, we’re left with this familiar view.

One caveat of not storing files yourself is that we don’t have access to file-specific metadata until we download the file. Meaning things like bitrate, length, encoding or any metadata are simply unavailable in the file explorer.
Player
I have used foobar2000 and SoundCloud for a good portion of the last decade. One thing I enjoy while listening to music is also seeing it.
- At the top we have a volume chart of the song composed of bars. Each bar represents the average volume of the song’s segment. Probably around 0.5%.
- The visualizer below splits the frequency spectrum by the number of bars and draws the average volume of each segment based on the
fftSize

Here’s how the volume bars in the upper chart are calculated
async function calculateBars(raw: AudioFileNode) {
const ctx = new AudioContext()
const buffer = await raw.arrayBuffer()
const audioBuffer = await ctx.decodeAudioData(buffer)
// Currently the levels are taken only from the left channel.
// Down the line this should be average volume from both channels
const rawAudio = audioBuffer.getChannelData(0)
// Get all the samples within a single bar
const barSize = Math.floor(rawAudio.length / amountOfBars)
const filtered = []
for (let i = 0; i < amountOfBars; i++) {
// the location of the first sample in the block
let sum = 0
for (let j = 0; j < barSize; j++) {
// Add all samples from each bar together
sum += Math.abs(rawAudio[(barSize * i) + j])
}
// Calculate the average volume of samples within a single bar
filtered.push(sum / barSize)
}
// This function finds the largest data point in the array with Math.max(),
// takes its inverse with Math.pow(n, -1)
// and multiplies each value in the array by that number.
// This guarantees that the largest data point will be set to 1,
// and the rest of the data will scale proportionally.
const multiplier = Math.max(...filtered) ** -1
const result = filtered.map(n => n * multiplier)
return result
}
I did not write this completely from scratch all by myself. Thanks to this absolute banger of an article I was able to implement this. And it taught me a lot about how to work with audio in the process. Thanks, Matthew Ström.
Closing notes
I pick this project up for a week every few months because, as it turns out, managing audio state, accurately timing functions and so forth is very draining. There are many bugs and it still needs a lot of work. But it is one of my favorite passion projects.
At some point I’d like to also create a PWA and instead of Dropbox, you give it a folder to scan audio files from. I’d love to ditch foobar2000.
