if and else

Hi a really basic question-

I'm using the if statement to start playing music- if sensor reading is above a certain threshold, stop and then start up again-how do I write the action of stopping the music?

void loop() {
    long start = millis();
    long total1 =  cs_11_8.capacitiveSensor(30);
    if (total1 > threshold) {
     
  root.rewind();
  play(root);
} else ????//here is where I am having trouble...
}

I would like to have some more variation- but for now I'll settle for starting and stopping and starting!!

thanks

first millis() retuns unsigned long.

ssecond, please post a whole sketch as halve sketches can not be tested

third, user CTRL T to get auto format makein the code more readable

fourth, stopping the music depends on the libraries you use, but forgot to mention ...

in short, the more info you give the better answers you get :wink: