From gogo@SEAS.GWU.EDU Wed Jun 23 11:29:51 1999 Received: from burdell.cc.gatech.edu (root@burdell.cc.gatech.edu [130.207.3.207]) by lennon.cc.gatech.edu (8.9.1/8.9.1) with ESMTP id LAA12357 for ; Wed, 23 Jun 1999 11:29:51 -0400 (EDT) Received: from asbestos.hitl.washington.edu (hitl-new.hitl.washington.edu [128.95.73.60]) by burdell.cc.gatech.edu (8.9.1/8.9.1) with ESMTP id LAA11443; Wed, 23 Jun 1999 11:29:48 -0400 (EDT) Received: from seas.gwu.edu (osgood.seas.gwu.edu [128.164.9.13]) by asbestos.hitl.washington.edu (8.9.3/8.9.3) with ESMTP id IAA02587; Wed, 23 Jun 1999 08:27:33 -0700 (PDT) Received: from felix.seas.gwu.edu (gogo@felix.seas.gwu.edu [128.164.9.3]) by seas.gwu.edu (v8) with ESMTP id LAA21660; Wed, 23 Jun 1999 11:27:32 -0400 (EDT) Received: from localhost (gogo@localhost) by felix.seas.gwu.edu (8.9.1a/8.9.1) with ESMTP id LAA01293; Wed, 23 Jun 1999 11:27:30 -0400 (EDT) X-Authentication-Warning: felix.seas.gwu.edu: gogo owned process doing -bs Date: Wed, 23 Jun 1999 11:27:29 -0400 (EDT) From: "Robert W. Lindeman" To: Mark Billinghurst cc: 3-D User Interaction Mailing List <3d-ui@hitl.washington.edu> Subject: Re: Sound Systems (Was: eye-tracking) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Status: RO On Tue, 22 Jun 1999, Mark Billinghurst wrote: > Has anyone had any luck with this ? It seems perfect for a project we're > doing but I'm having a tough time getting the sample programs to run. The > included executables run fine, but when I try and recompile and run them I > get segmentation faults. I'm trying this on an SGI O2.. > > I've emailed Hesham and he says that there will be a new version of his > library out in a couple of weeks, but it would be good to do some > programming with the old libraries now.. > > Any help most appreciated .. What version of VAS are you using? I have gotten VAS62 to work well. Unfortunately, Inventor isn't installed on the machines I'm using right now (where IRIX 6.5 is installed), so I can't try it here. I wouldn't worry so much about getting the demo programs to compile (I found it frustrating! ;-). Here is a snippet from my code that uses VAS to trigger simple collision events: ---8<---------8<---------8<---------8<---------8<---------8<---------8<--- // VAS Audio Class Definitions. #include #include class SoundInfo { public: AudActor *audActor; // Pointer to the auditory actor. LONG audSoundID; // Sound ID to use. CHAR *audFile; // Pointer to the file name. // Constructor. SoundInfo( ) { audActor = 0; audSoundID = 0L; audFile = 0; } }; SoundInfo SoundItems[2]; char *Module="TestModule"; char *DEF_AUD_SERVER_NAME = "bart"; // Default audio server machine. char *AudServerName = DEF_AUD_SERVER_NAME; // VAS server name to use. char UseAudio = TRUE; . . . AudWorld *MyAudWorld = 0; // Pointer to the audio server. char *sound1 = "click.aiff" char *sound2 = "unclick.aiff" if( UseAudio ) { MyAudWorld = new AudWorld( AudServerName ); // Let the audio server know that my units are centimeters // (i.e. 100 units per meter). MyAudWorld->SetUnitsPerMeter( 100.0 ); if( MyAudWorld->GetState( ) != ST_RUNNING ) { fprintf( stderr, "%s: main-> Connection to <%s> failed. Turning OFF audio.\n", Module, AudServerName ); UseAudio = FALSE; } } . . . if( UseAudio ) { // Create some standard sounds. UtilMakePathDir( sound1, &filename[0], SOUND_DIR_PATH ); SoundItems[0].audActor = new AudActor; SoundItems[0].audSoundID = SoundItems[0].audActor->AddSampledSound( filename ); SoundItems[0].audFile = new char[strlen(sound1)+1]; strcpy( SoundItems[0].audFile, sound1 ); UtilMakePathDir( sound2, &filename[0], SOUND_DIR_PATH ); SoundItems[1].audActor = new AudActor; SoundItems[1].audSoundID = SoundItems[1].audActor->AddSampledSound( filename ); SoundItems[1].audFile = new char[strlen(sound2)+1]; strcpy( SoundItems[1].audFile, sound2 ); } . . . if( UseAudio ) { // Trigger sound for some event. SoundItems[0].audActor->StartSound( SoundItems[0].audSoundID, VS_MANUAL ); } ---8<---------8<---------8<---------8<---------8<---------8<---------8<--- The three main parts of the process are: 1. Connecting to the vas server (which must be started prior to starting your app) 2. Telling vas which sound files you will be triggering 3. Triggering the sounds (e.g. for events). I hope this helps! -Rob --- _/ _/ _/ _/ * Robert W. Lindeman, Sc.D. _/_/ _/ _/ _/ _/ _/ _/ _/ _/ * Institute for Computer Graphics _/_/ _/ _/_/ _/ * The George Washington University _/ _/ * email: gogo@seas.gwu.edu _/_/_/ _/_/_/ * http://tangle.seas.gwu.edu/~gogo/