Skip to content

Instantly share code, notes, and snippets.

@gre
Forked from playxamplez-admin/CODE
Last active December 20, 2015 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gre/6053229 to your computer and use it in GitHub Desktop.
Save gre/6053229 to your computer and use it in GitHub Desktop.
Download an #OGG stream, add an echo effect, stream it again with #PlayCLI and #Iteratees
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2013 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
val audioStream: Enumerator[Array[Byte]] = getStream("http://radio.hbr1.com:19800/ambient.ogg")
val addEchoToOgg =CLI.pipe("sox -t ogg - -t ogg - echo 0.5 0.7 60 1")
def webRadioWithEcho = Action {
Ok.stream(audioStream &> addEchoToOgg)
.withHeaders(CONTENT_TYPE -> "audio/ogg")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment