Skip to content

Getting started

MMaillard edited this page Jun 27, 2024 · 2 revisions

Here we will instantiate a sound and play it, we just wait it to finish before closing the program.

int main() 
{
  // instantiate the Audio system, without it alive somewhere in the program it will not work. 
  Audio_System audioSystem;

  // instantiate a sound class and load file sfx1.wav
  Sound sfx("../Sound/sfx1.wav");

  // play it
  sfx.play();

  // play the file and close when the file stop
  while (sfx.getStatut() == Sound::Statut::playing) {
  ...
  }

  return 0;
}

Clone this wiki locally