4 #define sleep(x) Sleep(x*1000)
9 #include <simgear/debug/logstream.hxx>
10 #include <simgear/misc/sg_path.hxx>
12 #include "soundmgr_openal.hxx"
13 #include "sample_group.hxx"
14 #include "sample_openal.hxx"
16 int main( int argc, char *argv[] ) {
17 SGSampleQueue *squeue;
22 smgr = new SGSoundMgr;
25 smgr->select_device("OSS Default");
27 sgr = smgr->find("default", true);
28 smgr->set_volume(0.9);
30 smgr->set_position( SGVec3d::fromGeod(SGGeod()), SGGeod() );
35 std::string file = SRC_DIR"/jet.wav";
36 smgr->load(file, &data, &fmt, &len, &freq);
38 squeue = new SGSampleQueue( freq, fmt );
39 squeue->set_volume(1.0);
41 sgr->add(squeue, "queue");
43 squeue->add( data, len );
44 squeue->add( data, len );
46 printf("playing queue\n");
52 printf("source at lat,lon = (10,-10), listener at (9.99,-9.99)\n");
53 pos = SGGeod::fromDeg(9.99,-9.99);
54 sgr->set_position_geod( SGGeod::fromDeg(10,-10) );
55 smgr->set_position( SGVec3d::fromGeod(pos), pos );
57 squeue->add( data, len );
58 squeue->add( data, len );
59 squeue->play( true ); // play looped
60 printf("playing queue\n");