See site in english Voir le site en francais
Website skin:
home  download  forum  link  contact

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Author Topic: Sound coding  (Read 1810 times)

0 Members and 1 Guest are viewing this topic.

Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
15 July 2007, 12:29:45
I am having a problem with sound.  I can hear the sound for this vehicle I have coded but only if I turn the volume up high.
 Other vehicle sounds are good.

int MySoundID=ConnectToOrbiterSoundDLL3(GetHandle());
RequestLoadVesselWave3(MySoundID,ENG,"Sound\\Vessel\\Chariot\\chariot-go.wav",BOTHVIEW_FADED_FAR);
RequestLoadVesselWave3(MySoundID,START,"Sound\\Vessel\\Chariot\\chariot-start.wav",BOTHVIEW_FADED_FAR);
SoundOptionOnOff3(MySoundID,PLAYMAINTHRUST,FALSE);
SoundOptionOnOff3(MySoundID,PLAYATTITUDETHRUST,FALSE);

SoundOptionOnOff3(MySoundID,PLAYCOUNTDOWNWHENTAKEOFF,FALSE);

SoundOptionOnOff3(MySoundID,PLAYCABINAIRCONDITIONING,FALSE);

SoundOptionOnOff3(MySoundID,PLAYCABINRANDOMAMBIANCE,FALSE);

SoundOptionOnOff3(MySoundID,PLAYRADIOATC,FALSE);

SoundOptionOnOff3(MySoundID,DISPLAYTIMER,FALSE);
}

and then this:
double pit = (vsAirSpeed * pit2) + 11025;
 double sp = (190 +((vsAirSpeed)*5));
 if (sp>=225)sp=225;
  sprintf(oapiDebugString(),"ignition %2.2f", ignition );
{   
   PlayVesselWave3(MySoundID,ENG,LOOP,225,pit);



 if (vsAirSpeed < 1)
   {
   
   PlayVesselWave3(MySoundID,ENG,LOOP,190);
 Any ideas?


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 258
  • Hein, quoi !?
    • FsPassengers
Reply #1 - 16 July 2007, 00:34:11
Quote
gattico a écrit:
int MySoundID=ConnectToOrbiterSoundDLL3(GetHandle());

At first and at least "MySoundID" is local while it should be class global (declared in class)
as is it above you declare it also local (int MySoundID) and it's not the global that get the value
but this local variable.

In brief, remove "int".

Hope this help ?

Dan

« Last Edit: 16 July 2007, 02:35:45 by DanSteph »

Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
Reply #2 - 16 July 2007, 02:35:45
Quote
DanSteph wrote:
Quote
gattico a écrit:
int MySoundID=ConnectToOrbiterSoundDLL3(GetHandle());

At first and at least "MySoundID" is local while it should be class global (declared in class)
as is it above you declare it also local (int MySoundID) and it's not the global that get the value
but this local variable.

In brief, remove "int".

Hope this help ?

Dan

Yes, that fixed it.
Thanks

« Last Edit: 16 July 2007, 02:35:45 by gattico »