Random question with song

I’m stuck that I cannot make a song match a random question.
Can anybody help, please?

import processing.sound.*;
SoundFile file;

String[] Texts = {
  "Question A", 
  "Question B", 
  "Question C", 
  "Question D", 
  "Question E", 
  "Question F", 
  "Question G"
};

String[] RightAnswer = {
  "Yes", 
  "No", 
  "Yes", 
  "No", 
  "No", 
  "Yes", 
  "No"
};

int n = int (random(0, 6));

//String myText;
int totalWrong = 0;
int totalCorrect = 0;
//int question = 0;
//String correctAnswer;
//String WrongAnswer;
//int True= 0;
//int False= 0;

void setup() {
  size(800, 400);
  background(255);
  smooth();
  ellipseMode(CENTER);
}

void draw() {
  // draw() runs 60 times per second again and again

  // we clear the screen to WHITE  
  background(255);

  // we show stuff 
  noStroke();

  //Button 1
  fill(255, 20, 40);
  if (button1()) 
    fill(0, 255, 0); 
  ellipse(320, 100, 20, 20);
  text("YES", 320+22, 100);

  //Button 2
  fill(255, 20, 40);
  if (button2()) 
    fill(0, 255, 0); 
  ellipse(420, 100, 20, 20);
  text("NO", 420+22, 100); 

  fill(0);
  rect(width/2, height/2, 300, 100);
  textSize(20);
  text(Texts[n], 10, 30);
  if (Texts[0]),  file.play();
  text(RightAnswer[n], 10, 30+22);```

Do you want to play a different song for each Question?

Or the same song for each new question?

When you want to play a different song for each Question

When you want to play a different song for each Question:

Make an Array, the array has the same length like Texts and RightAnswer
which means the song for Texts number 0 is also number 0.

before setup()
SoundFile[] myCoolSongs = new SoundFile[7];

fill the array in setup()

myCoolSongs[0] = new SoundFile(this, “will.wav”);
myCoolSongs[1] = new SoundFile(this, “reel.wav”);
myCoolSongs[2] = new SoundFile(this, “hitaa.wav”);

and so on.

NOW, when you ask question number n play also the song number n:

myCoolSongs[n].play();

then you don’t need if