A music library for Java: what is playing, playback controls and synced lyrics, from any source.
It reads the media sessions of the operating system (Windows, Linux, macOS), so it works with any player and needs no account, and it accepts data pushed in from your own player. Everything a source can do is a capability you ask for at run time: playback state, controls, queue, devices, library, lyrics, cover colours. Nothing is tied to one music service, nothing touches the network, and unsupported operations answer “unsupported” instead of throwing.
Requirements
| Java | 17 or newer. No dependencies. |
| Windows | 10 version 1809 or newer, or 11, x64. Uses a small native library bundled in the jar. |
| Linux | A session bus with MPRIS players. Pure Java. |
| macOS | Experimental. Uses a bundled helper process; see docs/platforms.md. |
On Java 24 and newer the JVM warns about native access on Windows unless it is started with
--enable-native-access=ALL-UNNAMED.
Usage
Orpheus orpheus = Orpheus.builder().source(SystemSessions.create()).build();
orpheus.start();
// any thread, every frame, no allocation
Playback now = orpheus.playback();
if (now.isPresent()) {
draw(now.track().title(), now.track().artistLine());
drawBar(now.timeline().progressAt(System.nanoTime()));
}More examples (events, controls, synced lyrics, pushing your own player in) and the privacy rules are in the README.
Links
- Platforms: what each system provides and how native code is handled
- Javadoc for
lol.trq.orpheus - The live harness, benchmarks and the changelog