goxr3plus / java-stream-player

🌌Java Advanced Audio Controller Library (WAV, AU, AIFF, MP3, OGG VORBIS, FLAC, MONKEY's AUDIO and SPEEX audio formats )
GNU General Public License v3.0
147 stars 33 forks source link

Make StreamPlayer#reset public #7

Closed TonalidadeHidrica closed 5 years ago

TonalidadeHidrica commented 5 years ago

I looked for a way to freeing the resources opened by the StreamPlayer and found StreamPlayer#reset method, but it was private and was not accessible from outside. Why is it private? Is it possible to make it public? (I also found that calling StreamPlayer#open method calls this reset method so it seems I don't have to worry so much as long as I used same StreamPlayer instance.)

goxr3plus commented 5 years ago

Calling the .stop() method will free up all the resources, have a look at it :)

goxr3plus commented 5 years ago

Please try. stop() and let me know :)

TonalidadeHidrica commented 5 years ago

But stop() does not close file stream, audio output stream etc, right? It seems that the only way to close them is calling reset().

goxr3plus commented 5 years ago

Please check the latest release :) https://github.com/goxr3plus/java-stream-player/releases

9.0.1 solves exactly what you asked for :)