Skip to content

Instantly share code, notes, and snippets.

@thanatos
Last active July 23, 2018 04:17
Show Gist options
  • Save thanatos/11205540 to your computer and use it in GitHub Desktop.
Save thanatos/11205540 to your computer and use it in GitHub Desktop.
A real audio player

Some notes on what an audio player (somewhat targeted at dancers / DJs) should support:

This is a side project I'd like to try my own hand at some time. If you want ultimate, I've got a few requirements from an interesting angle for you: I'm both a dancer, and in some regards a DJ. Specifically, I tend to play music for dancers. iTunes absolutely falls down here.

  • Replay gain: Replay gain is an amazing feature, and once you have it, you never want to be without it.
  • Do not trust duration tags. They lie. A lot of media players (Foobar2000 included!) trust these. Or assume MP3s are CBR, and that the remainder is the same bit-rate as the rest. It greatly affects usability too, when the player thinks a 3 minute song is 30 minutes, and scales the seeking bar to that point.
  • Robust codec support ogg and flac are a must, as they're the two best formats out there. (ogg beats the pants off mp3, and it beats mp4 by virtue of no patents; flac is the only good lossless codec I know of, which is important¹.)
  • "Stop after current song": automatically pausing after this song, both as a one-time option (I need to pause the music to allow someone to speak at a mic), or all the time (I want a playlist, but I want to manually start each piece. Think performance: double-click to start, people dance, but it pauses after to give dancers time for costume changes/etc. No short burst of the front end of the next song.)
  • The ability to drop in "bookmarks" into the seek bar, and assign names to specific time indexes. As dancers, we name sections of the dance in order to remember it: being able to seek directly to a section would be awesome. Having the player understand the BPM of the song (even if I have to tap a spacebar to the music for it) would be more awesome. Having it start 8 beats before my bookmark (to give the dancer's brains time to sync with the music) would be amazing. Having a metronome tick those 8 beats over the music would be mind-blowing. (Also, computers tend to get attached to rather heavy audio equipment, and I'm a dancer, out on a floor somewhere. If I could initiate this from my phone, I'd be a god among audio tech.)
  • A volume bar in decibels. The human ear does not hear in "percent". Also, an input box and button to say "fade to x db (or to silent) in n second, and go" for automatic fade out/ins would be amazing. (And partial fadeouts: if you have an announcer welcoming in people/dancers, you might fade the music down a bit while he talks, but then fade it back to full while people walk in and crowd goes wild. some sort of ticks above a volume bar that I can set…)
  • Queue into playlists. A playlist might have A, B, C, but then a request comes in for D. Some players have a "queue" that gets emptied before the playlist progresses, so if the playlist is on B, and I "queue up" D, then the next song is D, then C, but the playlist is unchanged.
  • Support for multiple audio cards. "Can you play this random, totally non-sketch mp3?" I have an audio port controlling speakers blasting music, and I can't just unplug it. Either I lug around a completely separate laptop, or I have a USB audio device with headphones. Two audio jacks: I want to play to both, at times.
  • Raw gain, even if it results in clipping. Dancers sometimes end up in practice sessions stranded with the most pathetic of audio equipment, and it becomes more important to be able to hear the music than for it to sound good.
  • "Shadow Pause": Pause musical output, but keep tracking both the position of when the music was paused, and where it would be as if it hadn't. The former is a real pause, the latter is more like mute. Why? Dancers are indecisive sometimes; sometimes, you'll think they want a stop, but will really want to keep going. In that case, you want to unpause at the position the dancers are still dancing at. But, sometimes, it really is a pause, and then you want to pick up there later.
  • Ctrl+Z for playback. Every one of us has accidentally started another track. Ooops. Ctrl+Z should take you back to the previous track, accounting for the time as if you never messed it up. Dancers marking time shouldn't be too far off.

¹When you're a dancer, you create "cuts", or shortened/altered versions of songs to accommodate the choreography. It's like saving a JPEG multiple times: the "loss" in the lossy encodings add up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment