项目作者: andrewrlee

项目描述 :
loop random samples of mp3s
高级语言: Java
项目地址: git://github.com/andrewrlee/rand-mp3.git
创建时间: 2017-02-22T23:29:38Z
项目社区:https://github.com/andrewrlee/rand-mp3

开源协议:Apache License 2.0

下载


rand-mp3

Loop random samples of mp3s

A pure java port of Cutups.

Thought I’d have a go at hacking it out with the javaFX mediaplayer because haven’t really done any javaFX or media stuff in java and seemed like an interesting problem.

It only has a dependency on pure java 8/maven (as javaFX is bundled with jdk8).

Given a folder full of music, it will pick a random mp3 and choose a random part of the file to play.
It will then loop a random sized sample from a random position inside the track.

  • Pressing r then enter will start playing another random sample from the same file.
  • Pressing f then enter will start playing another random sample from a random file.
  • Typing quit (or q) then enter will then exit the program.

The main entry point of the program is the Runner class

Build executable jar via standard mvn clean install.

Usage:

  1. java -jar rand-mp3.jar <file-path> <longest possible sample in seconds>

e.g:

  1. java -jar target/rand-mp3-0.0.1-SNAPSHOT.jar "/home/alee/Desktop/Cowboy Bebop/" 4

Limitations:

  • Doesn’t record the resulting sound
  • Only displays how much of the track was skipped after hitting enter
  • Only tested on linux
  • Hacked together / code is a bit crappy

Sample output:

  1.  
  2. Starting new track, sample length: 7.953 seconds; For track: "The Seatbelts, Cowboy Bebop Blue - 09-Adieu.mp3"
  3.  
  4. That sample started at 141.0 seconds
  5.  
  6.  
  7. ######################################
  8. Starting new track, sample length: 1.84 seconds; For track: "The Seatbelts, Cowboy Bebop No Disc - 07-Want It All Back.mp3"
  9.  
  10. That sample started at 138.0 seconds
  11.  
  12.  
  13. ######################################
  14. Starting new track, sample length: 3.39 seconds; For track: "The Seatbelts, Cowboy Bebop Boxed Set (CD 03) - 15-WO QUI NON COIN (Short Sad Version).mp3"
  15.  
  16. That sample started at 94.0 seconds
  17.  
  18.  
  19. ######################################
  20. Starting new track, sample length: 4.654 seconds; For track: "The Seatbelts, Cowboy Bebop Remixes Music for Freelance - 07-Radio Free Mars Talk 4.mp3"
  21.  
  22. That sample started at 9.0 seconds
  23.  
  24.  
  25. ######################################
  26. Starting new track, sample length: 7.879 seconds; For track: "The Seatbelts, Cowboy Bebop - 15-Rain.mp3"
  27. quit
  28. That sample started at 186.0 seconds
  29.  
  30.  
  31. ######################################
  32. bye!
  33.