I am hoping to create a basic music player using Java. Looking at the Java API it appears that the choices for playback are using either a Clip or a SourceDataLine.
Clip seems like the easy option, however the downside is that it loads the whole file to memory before playback which is fine for small files, but large files will consume large amounts of memory if my understanding is correct.
SourceDataLine solves this problem by constantly buffering smaller portions of the file but apparently loses the flexibility clip provides such as skipping playback to another position, easily pausing/resuming a track.
What is the best way to approach this in Java?
Aucun commentaire:
Enregistrer un commentaire