# Audio plays but screen stays black

**URL:** https://discourse.processing.org/t/audio-plays-but-screen-stays-black/14586
**Category:** Electronics (Arduino, etc.)
**Created:** [October 10, 2019, 8:00pm UTC](https://discourse.processing.org/t/audio-plays-but-screen-stays-black/14586 "2019-10-10T20:00:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![SimonRedfox](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@SimonRedfox](https://discourse.processing.org/u/SimonRedfox)
#### Post date: [October 10, 2019, 8:00pm UTC](https://discourse.processing.org/t/audio-plays-but-screen-stays-black/14586/1 "2019-10-10T20:00:15Z")

</div>

Here is my code, the scenario is opened from Arduino button. One button plays 1 and the other 2. The buttons and the printing work good. The screen opens, audio plays but the movie/frames don’t.

```auto
import processing.serial.*;
import processing.video.*;

Serial port;

PImage img1, img2;

Movie movie1, movie2;

void setup(){
  fullScreen();

  background(0);
  
  printArray(Serial.list()); //print alle serial poorten
 
  port = new Serial(this, "/dev/cu.SLAB_USBtoUART", 9600);
  
  img1 = loadImage("IMG_3147.jpg");
  
  img2 = loadImage("IMG_2395.JPG");

  newStart();

}

void movies(){
  movie1 = new Movie(this, "IMG_0585.mp4");

  movie1.loop();

  movie2 = new Movie(this, "IMG_0574.mp4");

  movie2.loop();
}

void movieEvent(Movie m) {
  m.read();
}

void newStart(){
  background(0);
}

void draw(){
     int scenario = port.read();
     println(scenario);
     
    if (scenario == 2) { 
      movies();
      movie1.play(); 
      if (movie1.available()) {
        movie1.read(); 
      }
      image(movie1, 0, 0, width, height);
    }
    
    if (scenario == 1) { 
      movies();
      movie2.play(); 
      if (movie2.available()) {
        movie2.read(); 
      }
      image(movie2, 0, 0, width, height);
    }
     
     if (scenario == -1){
       int lachen = 3;
       println(lachen);
       delay(100);
     }
}
 

```

---

<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: [October 11, 2019, 1:52am UTC](https://discourse.processing.org/t/audio-plays-but-screen-stays-black/14586/2 "2019-10-11T01:52:20Z")

</div>

-a- loading movie files from draw ( in every draw loop ) is a bad idea  
only in setup()

-b-  
i think this is all the code you need in draw()

```auto
  if (scenario == 2) image(movie1, 0, 0, width, height);
  if (scenario == 1) image(movie2, 0, 0, width, height);

```

-c-

- do not post code what can not run in fullscreen mode
- clean up and take out all what is not needed to test your problem here
- 
  - the arduino thing  
and change the category back to library )  
and state that you use the movie library you have have problems to use

- 
  - the images we not have you load but not use
