Building an Spotify and Apple Music powered A/B Player for R.E.M.

Supporting the 25th Anniversary of Monster

Image for post
Image for post

Switching Between 30 Second MP3 Clips

Image for post
Image for post
let a = new Howl({
src: ['original.mp3']
})
let b = new Howl({
src: ['remix.mp3']
})
b.volume(0)let mix = 0
function togglePlayback() {
if (a.playing()) {
a.pause()
b.pause()
} else {
a.play()
b.play()
}
}
function toggleMix() {
if (mix == 0) {
mix = 1
a.volume(0)
b.volume(1)
} else {
mix = 0
a.volume(1)
b.volume(0)
}
}

Switching Between Full Audio

spotify.put(
`me/player/play?device_id=${device_id}`,
{
uris: [current_track_uri],
position_ms: position
}
)
apple.setQueue({
song: current_track_id
}).then(() => {
apple.player.play()
.then(() => {
apple.player.seekToTime(
position
)
})
})

Bonus: Instagram and Facebook AR Filter

Built in Spark AR

Thanks

Image for post
Image for post
Jem Cohen

Written by

I develop websites for rock 'n' roll bands and get paid in sex and drugs. Previously Silva Artist Management, SoundCloud, and Songkick. Currently: Available

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store