Tweaking sound library usage.
This commit is contained in:
parent
b3c537ff79
commit
88ceb3dbb8
2 changed files with 27 additions and 10 deletions
|
@ -89,8 +89,8 @@ int displayInstruments;
|
||||||
#ifdef HAVE_OSS_AUDIO
|
#ifdef HAVE_OSS_AUDIO
|
||||||
slScheduler audio_sched ( 8000 ) ;
|
slScheduler audio_sched ( 8000 ) ;
|
||||||
smMixer audio_mixer ;
|
smMixer audio_mixer ;
|
||||||
slSample *s1;
|
slSample s1;
|
||||||
slSample *s2;
|
slSample s2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -632,6 +632,7 @@ int main( int argc, char **argv ) {
|
||||||
fgFLIGHT *f;
|
fgFLIGHT *f;
|
||||||
fgOPTIONS *o;
|
fgOPTIONS *o;
|
||||||
char config[256];
|
char config[256];
|
||||||
|
char path[256], slfile[256];
|
||||||
int result; // Used in command line argument.
|
int result; // Used in command line argument.
|
||||||
|
|
||||||
f = current_aircraft.flight;
|
f = current_aircraft.flight;
|
||||||
|
@ -708,11 +709,22 @@ int main( int argc, char **argv ) {
|
||||||
#ifdef HAVE_OSS_AUDIO
|
#ifdef HAVE_OSS_AUDIO
|
||||||
audio_mixer . setMasterVolume ( 30 ) ; /* 50% of max volume. */
|
audio_mixer . setMasterVolume ( 30 ) ; /* 50% of max volume. */
|
||||||
audio_sched . setSafetyMargin ( 1.0 ) ;
|
audio_sched . setSafetyMargin ( 1.0 ) ;
|
||||||
s1 = new slSample ( "/dos/X-System-HSR/sounds/xp_recip.wav", &audio_sched );
|
strcpy(path, o->fg_root);
|
||||||
s2 = new slSample ( "/dos/X-System-HSR/sounds/wind.wav", &audio_sched );
|
strcat(path, "/Sounds/");
|
||||||
s2 -> adjustVolume(0.5);
|
|
||||||
audio_sched . loopSample ( s1 );
|
strcpy(slfile, path);
|
||||||
audio_sched . loopSample ( s2 );
|
strcat(slfile, "prpidle.wav");
|
||||||
|
// s1 . loadFile ( slfile );
|
||||||
|
s1 . loadFile ( slfile );
|
||||||
|
printf("Rate = %d Bps = %d Stereo = %d\n",
|
||||||
|
s1.getRate(), s1.getBps(), s1.getStereo());
|
||||||
|
audio_sched . playSample ( &s1 );
|
||||||
|
|
||||||
|
strcpy(slfile, path);
|
||||||
|
strcat(slfile, "thunder.wav");
|
||||||
|
// s2 . loadFile ( slfile );
|
||||||
|
// s2 . adjustVolume(0.5);
|
||||||
|
// audio_sched . playSample ( &s2 );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// pass control off to the master GLUT event handler
|
// pass control off to the master GLUT event handler
|
||||||
|
@ -732,6 +744,9 @@ extern "C" {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.21 1998/06/03 22:01:06 curt
|
||||||
|
// Tweaking sound library usage.
|
||||||
|
//
|
||||||
// Revision 1.20 1998/06/03 00:47:11 curt
|
// Revision 1.20 1998/06/03 00:47:11 curt
|
||||||
// Updated to compile in audio support if OSS available.
|
// Updated to compile in audio support if OSS available.
|
||||||
// Updated for new version of Steve's audio library.
|
// Updated for new version of Steve's audio library.
|
||||||
|
|
|
@ -50,9 +50,8 @@ int fgAIRPORTS::load( char *file ) {
|
||||||
|
|
||||||
o = ¤t_options;
|
o = ¤t_options;
|
||||||
|
|
||||||
// build the path name to the ambient lookup table
|
// build the path name to the airport file
|
||||||
path[0] = '\0';
|
strcpy(path, o->fg_root);
|
||||||
strcat(path, o->fg_root);
|
|
||||||
strcat(path, "/Scenery/");
|
strcat(path, "/Scenery/");
|
||||||
strcat(path, "Airports");
|
strcat(path, "Airports");
|
||||||
strcpy(fgpath, path);
|
strcpy(fgpath, path);
|
||||||
|
@ -104,6 +103,9 @@ fgAIRPORTS::~fgAIRPORTS( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.7 1998/06/03 22:01:07 curt
|
||||||
|
// Tweaking sound library usage.
|
||||||
|
//
|
||||||
// Revision 1.6 1998/06/03 00:47:13 curt
|
// Revision 1.6 1998/06/03 00:47:13 curt
|
||||||
// Updated to compile in audio support if OSS available.
|
// Updated to compile in audio support if OSS available.
|
||||||
// Updated for new version of Steve's audio library.
|
// Updated for new version of Steve's audio library.
|
||||||
|
|
Loading…
Add table
Reference in a new issue