Again, sorry I haven’t been on in a while. I’ve been crazy busy with my academic life.
What TinySound does when streaming is it first loads the whole thing into memory to convert to the correct format, writes it to a temporary file, and then streams that. It can thus end up using a lot of memory at loading time, but that should be drastically reduced when streaming. Now, depending on how you monitor memory usage, it can still appear to be using a lot more memory. If you just look at how much memory the JVM has been allocated (e.g. the Task Manager on Windows, or top on Linux), it will be large. This is because it needed that memory at some point. The actual heap space in use when streaming, however, should be much lower. You can tell how much memory is actually in use with something like:
double mbInUse = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1048576.0);
A better solution would be to convert the audio data to the correct format as it’s being read and written out to the temporary file, but I haven’t done that. I don’t think it’s trivial either.