27 for (i = 0; i<4; i++) {
48 int MAX_N_ENGINE_SOUNDS = 8;
51 fprintf (stderr,
"Warning: maybe insufficient channels\n");
61 for (
int id=0;
id<n_cars;
id++) {
static CarSoundData ** car_sound_data
TorcsSound * bang_sound
sounds when suspension fully compressed
int curCrashSnd
holds current crash sound used - the sound cycles
virtual void setPitch(float pitch)
Set the pitch.
A queue containing mappings between sounds and sound sources.
TorcsSound * bottom_crash_sound
bang when crashing from a great height
QSoundChar CarSoundData::* schar
The calculated sound characteristic.
TorcsSound * curb_ride_sound
rolling on curb
Manages the source sound of each individual car.
TorcsSound * backfire_loop_sound
exhaust backfire sound
void SetMaxSoundCar(CarSoundData **car_sound_data, QueueSoundMap *smap)
Using the smap->id, get the appropriate entry in car_sound_data and call apprioriate methods for smap...
TorcsSound * grass_skid_sound
skidding on dirt/grass
TorcsSound * turbo_sound
turbo spinning sound
TorcsSound * road_ride_sound
rolling on normal road
virtual void setSource(sgVec3 p, sgVec3 u)
float attenuation
global distance attenuation
int n_channels
number of channels
TorcsSound * snd
The raw sound.
virtual void setVolume(float vol)
Set the volume.
void SortSingleQueue(CarSoundData **car_sound_data, QueueSoundMap *smap, int n_cars)
Find the max amplitude sound in car_sound_data and put it in smap.
void getCarPosition(sgVec3 p)
float sampling_rate
sampling rate
TorcsSound * gear_change_sound
sound when changing gears
int n_engine_sounds
number of simultaneous engines
void getCarSpeed(sgVec3 u)
SoundInterface(float sampling_rate, int n_channels)
Make a new sound interface.
TorcsSound * crash_sound[NB_CRASH_SOUND]
list of crash sounds
TorcsSound * metal_skid_sound
metal skidding on metal
TorcsSound * grass_ride_sound
rolling on dirt/grass
TorcsSound * axle_sound
axle/gear spinning sound
TorcsSound * skid_sound[4]
set of skid sounds, one per tyre
int id
The id of the car producing the sound, used for retrieving doppler effects etc.