How to achieve a repeat function that can be stopped

Yes.

void loop()
{
  static unsigned long startTime = 0;

  if (millis() - startTime >= 600000ul) // Ten minutes
  {
    switch (condition)
    {
    case 1:  PlayFile1(); break;
    case 2:  PlayFile2(); break;
    case 3:  PlayFile3(); break;
    }
  }
}