3 // This is broken, but allows the file to compile without a POSIX
5 static unsigned int sleep(unsigned int secs) { return 0; }
7 #include <unistd.h> // sleep()
10 #include <simgear/debug/logstream.hxx>
11 #include <simgear/misc/sg_path.hxx>
13 #include "soundmgr_openal.hxx"
16 int main( int argc, char *argv[] ) {
20 smgr = new SGSoundMgr;
24 smgr->set_volume(0.9);
25 sgr = smgr->find("default", true);
27 SGSoundSample *sample1 = new SGSoundSample( SRC_DIR, "jet.wav" );
28 sample1->set_volume(1.0);
29 sample1->set_pitch(1.0);
30 sample1->play_looped();
31 sgr->add(sample1, "sound1");
33 printf("playing sample1\n");
36 SGSoundSample *sample2 = new SGSoundSample( SRC_DIR, "jet.wav" );
37 sample2->set_volume(0.5);
38 sample2->set_pitch(0.4);
39 sample2->play_looped();
40 sgr->add(sample2, "sound2");
42 printf("playing sample2\n");
45 SGSoundSample *sample3 = new SGSoundSample( SRC_DIR, "jet.wav" );
46 sample3->set_volume(0.5);
47 sample3->set_pitch(0.8);
48 sample3->play_looped();
49 sgr->add(sample3, "sound3");
51 printf("playing sample3\n");
54 SGSoundSample *sample4 = new SGSoundSample( SRC_DIR, "jet.wav" );
55 sample4->set_volume(0.5);
56 sample4->set_pitch(1.2);
57 sample4->play_looped();
58 sgr->add(sample4, "sound4");
60 printf("playing sample4\n");
63 SGSoundSample *sample5 = new SGSoundSample( SRC_DIR, "jet.wav" );
64 sample5->set_volume(0.5);
65 sample5->set_pitch(1.6);
66 sample5->play_looped();
67 sgr->add(sample5, "sound5");
69 printf("playing sample5\n");
72 SGSoundSample *sample6 = new SGSoundSample( SRC_DIR, "jet.wav" );
73 sample6->set_volume(0.5);
74 sample6->set_pitch(2.0);
75 sample6->play_looped();
76 sgr->add(sample6, "sound6");
78 printf("playing sample6\n");
81 for (int i=0; i<10; i++) {