Loading...
Logo
Processing Forum
Hi,
I'm using minim to access the sample data of 300 wav files. This is done in a thread. The loading starts quickly then gradually slows until at about 250 the loading grinds to a stop. I thought it might be a memory issue but the total size of all the wavs is about 200kb.

Copy code
  1. loadThread = new Thread() {
  2. public void run() {
  3. int numLoaded = 0;
  4. for (HTRFPoint p : htrfPoints) {
  5. p.loadData();
  6. numLoaded++;
  7. main.println(numLoaded + " files of " + htrfPoints.size() + " loaded.");
  8. }

  9. main.println("All files loaded.");
  10. }
  11. };
  12. loadThread.start();

  13. public void loadData() {
  14. AudioSample sample = main.minim.loadSample(dir.getAbsolutePath(), 512);
  15. data[0] = sample.getChannel(1);
  16. data[1] = sample.getChannel(2);
  17. sample = null;
  18. }

Any ideas?

Cheers,

Rob

Replies(2)

If you're using Windows you may want to start Task Manager and watch how your memory usage / CPU utilization changes as you load more and more files.

Also, don't forget that there is overhead associated with each thread and that each thread has a priority.  It could be that as you launch more and more threads, you spend more and more time switching between threads.

Oops. I was thinking one thread per wav but it looks like 1 thread for all the wavs - is that correct?