Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualkd7tck

Posted 08 November 2012 - 06:00 PM

Use libphysfs, that will automate this task for you.

edit...
Just found out this was for java.

Why would you need an example for such a simple interface. You have input stream and output stream, thats it.
Once you figure out how streams can be opened and closed this should be a simple matter of filling in the gaps with common logic.

com.badlogic.gdx.utils.compression.Lzma.decompress(new FileInputStream(),new FileOutputStream());

As far as examples for using it to directly load the unzipped files into memory, you should do research into loading binary files using filestreams.

So here are the steps:
1)decompress files to temp directory
2)load binary data into memory or obtain file pointer for streaming the audio
3)load file pointer or data into audio decoder and play it.


Most of these tasks can be done using common java libs, you don't have to use libgdx for everything.

#1kd7tck

Posted 08 November 2012 - 04:16 PM

Use libphysfs, that will automate this task for you.

PARTNERS