]> git.mxchange.org Git - simgear.git/blob - simgear/sound/openal_test2.cxx
MINGW patch by Csaba Halasz
[simgear.git] / simgear / sound / openal_test2.cxx
1 #include <stdio.h>
2 #ifdef __MINGW32__
3 // This is broken, but allows the file to compile without a POSIX
4 // environment.
5 static unsigned int sleep(unsigned int secs) { return 0; }
6 #else
7 #include <unistd.h>     // sleep()
8 #endif
9
10 #include "sample_openal.hxx"
11 #include "soundmgr_openal.hxx"
12
13
14 int main( int argc, char *argv[] ) {
15     SGSoundMgr sm;
16
17     SGSoundSample sample1( SRC_DIR, "jet.wav" );
18     sample1.set_volume(0.5);
19     sample1.set_volume(0.2);
20     sample1.play_looped();
21     sleep(1);
22
23     SGSoundSample sample2( SRC_DIR, "jet.wav" );
24     sample2.set_volume(0.5);
25     sample2.set_pitch(0.4);
26     sample2.play_looped();
27     sleep(1);
28
29     SGSoundSample sample3( SRC_DIR, "jet.wav" );
30     sample3.set_volume(0.5);
31     sample3.set_pitch(0.8);
32     sample3.play_looped();
33     sleep(1);
34
35     SGSoundSample sample4( SRC_DIR, "jet.wav" );
36     sample4.set_volume(0.5);
37     sample4.set_pitch(1.2);
38     sample4.play_looped();
39     sleep(1);
40
41     SGSoundSample sample5( SRC_DIR, "jet.wav" );
42     sample5.set_volume(0.5);
43     sample5.set_pitch(1.6);
44     sample5.play_looped();
45     sleep(1);
46
47     SGSoundSample sample6( SRC_DIR, "jet.wav" );
48     sample6.set_volume(0.5);
49     sample6.set_pitch(2.0);
50     sample6.play_looped();
51     sleep(1);
52
53     sleep(10);
54 }