# Minim problem with loading multiple FilePlayer

**URL:** <https://discourse.processing.org/t/minim-problem-with-loading-multiple-fileplayer/17688>\
**Category:** Processing for Pi\
**Created:** [February 10, 2020, 1:40pm UTC](https://discourse.processing.org/t/minim-problem-with-loading-multiple-fileplayer/17688 "2020-02-10T13:40:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mokauno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mokauno/32/8045_2.png) [@mokauno](https://discourse.processing.org/u/mokauno)\
**Post date:** [February 10, 2020, 1:40pm UTC](https://discourse.processing.org/t/minim-problem-with-loading-multiple-fileplayer/17688/1 "2020-02-10T13:40:47Z")

</div>

Hi,  
I would like to use my raspberry pi 3 and processing to mix sound files.  
My problem is that minim crashes after loading 6 FilePlayer.  
I tried it on different setups : raspbian + processing pi, raspbian image provided on the site, Ubuntu + processing pi. The problem is always the same.  
Please note it works on a linux PC.  
Here is the minimal code to reproduce the problem. Is there a solution to load more sound file ? Would someone try this on a raspberry 4 ?  
Thanks.

```auto
import ddf.minim.*;
import ddf.minim.ugens.*;

Minim minim;
AudioOutput output;

FilePlayer[] soundfile = new FilePlayer[10];

void setup(){
  minim = new Minim(this);
  output = minim.getLineOut();
  
  for (int c=0; c<soundfile.length; c++) {
    print("load soundfile " + c + " ...");
    soundfile[c] = new FilePlayer( minim.loadFileStream(dataPath("beastie.wav")) );
    println("ok");
  }

}

```

console error :

* * *

load soundfile 0 …ok  
load soundfile 1 …ok  
load soundfile 2 …ok  
load soundfile 3 …ok  
load soundfile 4 …ok  
load soundfile 5 …ok  
load soundfile 6 …==== JavaSound Minim Error ====  
==== Couldn’t open the line: line with format PCM\_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.

NullPointerException

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [February 10, 2020, 3:57pm UTC](https://discourse.processing.org/t/minim-problem-with-loading-multiple-fileplayer/17688/2 "2020-02-10T15:57:54Z")

</div>

yes, i hit same limitation ( RPI3 ),

find a way to have not all files loaded at same time  
or try a other library ?beads?

sorry also not have a RPI4 to test.

---

<div class="post-metadata">

**Author:** ![mokauno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mokauno/32/8045_2.png) [@mokauno](https://discourse.processing.org/u/mokauno)\
**Post date:** [February 10, 2020, 5:18pm UTC](https://discourse.processing.org/t/minim-problem-with-loading-multiple-fileplayer/17688/3 "2020-02-10T17:18:34Z")

</div>

Thanks for your answer 🙂  
unfortunately, I have to load all sound at startup, so I can mix them with no delay.  
I could use bead, but it would be a lot of work, as it is a big project working on PC, that I want to put on a raspberry.  
If someone could confirm that the problem would be solved with a PI 4, I would buy one immediately 😁

---

<div class="post-metadata">

**Author:** ![mokauno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mokauno/32/8045_2.png) [@mokauno](https://discourse.processing.org/u/mokauno)\
**Post date:** [February 13, 2020, 5:12pm UTC](https://discourse.processing.org/t/minim-problem-with-loading-multiple-fileplayer/17688/4 "2020-02-13T17:12:32Z")

</div>

I have tried the same code on a RPI4, and there is exactly the same problem.  
It was a model B 4GB with raspbian freshly installed and processing pi downloaded and installed from the site.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [February 15, 2020, 5:56am UTC](https://discourse.processing.org/t/minim-problem-with-loading-multiple-fileplayer/17688/5 "2020-02-15T05:56:18Z")

</div>

Maybe there is way of reducing your memory requirements from six+ simultaneous full loads. When you say ‘mix’ what do you mean? Are you crossfading, or playing everything simultaneously? Are these sort sounds that could be played as samples?

---

<div class="post-metadata">

**Author:** ![mokauno](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mokauno/32/8045_2.png) [@mokauno](https://discourse.processing.org/u/mokauno)\
**Post date:** [February 15, 2020, 9:26am UTC](https://discourse.processing.org/t/minim-problem-with-loading-multiple-fileplayer/17688/6 "2020-02-15T09:26:36Z")

</div>

Hi,  
I have to mix several 10s loops together. All the loops have to be played simultaneous, I control the volume of each loop with a midi controller, and want to avoid a load delay during playing.  
I will try to use the Beads library, and will give you feedback if I find a solution.
