Advertisement
koronabora

soloud

Aug 8th, 2020
822
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include <stdlib.h>
  2.  
  3. #include "soloud.h"
  4. #include "soloud_speech.h"
  5. #include "soloud_wav.h"
  6. #include "soloud_thread.h"
  7.  
  8. // Entry point
  9. int main(int argc, char *argv[])
  10. {
  11.     // Define a couple of variables
  12.     SoLoud::Soloud soloud;  // SoLoud engine core
  13.     SoLoud::Speech speech;  // A sound source (speech, in this case)
  14.     SoLoud::Wav sound;
  15.     sound.load("Kalimba.mp3");
  16.     // Configure sound source
  17.     speech.setText("1 2 3   1 2 3   Hello world. Welcome to So-Loud.");
  18.     // initialize SoLoud.
  19.     soloud.init();
  20.     // Play the sound source (we could do this several times if we wanted)
  21.     soloud.play(sound);
  22.     // Wait until sounds have finished
  23.     while (soloud.getActiveVoiceCount() > 0)
  24.     {
  25.         // Still going, sleep for a bit
  26.         SoLoud::Thread::sleep(100);
  27.     }
  28.     // Clean up SoLoud
  29.     soloud.deinit();
  30.     // All done.
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement