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: How many sounds?  (Read 1770 times)

0 Members and 1 Guest are viewing this topic.

Offline movieman

  • Jr. Member
  • **
  • Posts: 23
  • Karma: 0
27 September 2003, 13:35:14
Quick question on orbitersound itself: are the sixty sounds per-module, or global? That is, can I have
sixty sounds for the CSM module and another sixty for the LEM module, or does loading a sound in the CSM
reduce the number I can load in the LEM?

Since I'm probably going to want a lot more than sixty sounds during the course of an Apollo mission I'm
planning to write some higher-level code that would treat the sixty as a cache and load files as
required, so I just wanted to check whether each module can have a full sixty sounds loaded or whether I
have to split it into thirty for each module (which would be pretty limiting as many of the basic sounds
are required all the time).


Offline DanSteph

  • Administrator
  • Legend
  • *****
  • Posts: 15407
  • Karma: 256
  • Hein, quoi !?
    • FsPassengers
Reply #1 - 27 September 2003, 19:26:38
sixty sounds global,

The good idea that will allow you to have several thousand sound if you want
is to load them dynamically before using them, this will work especially good
if you want to make adventure with sound played only one time.
there is about NO latency I'v noticed while loading sound during execution.

You need to have three sound slot. When one is already played you can load
a new sound into it (LoadVesselWave destroy the previous sound and replace it
with the new loaded, no worry about freeing ressource)


Here below an example in "pseudo C++ code"


---------------- CODE CODE CODE CODE-------------------------------------------
// variable the three slot that will always be used
SOUND  speechA
SOUND  speechB
SOUND  speechC


// init time we load the first three sound
Loadwave(&speechA,"WAVE1.wav");
Loadwave(&speechB,"WAVE2.wav");
Loadwave(&speechC,"WAVE3.wav");


// in you main loop you must put a flag that is responsible to play
//the sound at the right time I recommend a "while(); case N" loop code
// I keep it simple below.

// PLAY WAVE 1
if(PlaySequence==1)  
{
PlayVesselWave(speechA);    
}

// PLAY WAVE 2
if(PlaySequence==2)  
{
PlayVesselWave(speechB);
// now we are sure the slot "A" is useless it's time to load the WAV4 into it:
Loadwave(&speechA,"WAVE4.wav");
}

// PLAY WAVE 3
if(PlaySequence==3)  
{
PlayVesselWave(speechC);
// now we are sure the slot "B" is useless it's time to load the WAV5 into it:
Loadwave(&speechB,"WAVE5.wav");
}

// PLAY WAVE 4
if(PlaySequence==4)  
{
PlayVesselWave(speechA);
// now we are sure the slot "C" is useless it's time to load the WAV6 into it:
Loadwave(&speechC,"WAVE5.wav");
}


// NOW YOU CAN RUN FOREWER WHILE USING THIS SYSTEM:

// PLAY WAVE 5
if(PlaySequence==5)  
{
PlayVesselWave(speechB);
// now we are sure the slot "A" is useless it's time to load the WAV7 into it:
Loadwave(&speechA,"WAVE6.wav");
}


etc etc etc

----------------------- END OF PSEUDO CODE -----------------------------------------


Tell me if it help or if you have some trouble to understand how it work
but this is the way to go, I use it myself in the DGII.


Dan

« Last Edit: 27 September 2003, 19:26:38 by DanSteph »