How to Stop Current Playing Song When using one thread with JLayer?
- by mcnemesis
I recently used a solution to the one-thread-at-a-time problem whe using Jlayer to play mp3 songs in Java. But this solution by Kaleb Brasee didn't hint at how you could stop the player, i.e how could one then call player.close()?
Kaleb's code was:
Executor executor = Executors.newSingleThreadExecutor();
executor.execute(new Runnable() { public…