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++) {
struct QSoundChar_ QSoundChar
struct QueueSoundMap_ QueueSoundMap
A queue containing mappings between sounds and sound sources.
Manages the source sound of each individual car.
float attenuation
global distance attenuation
SoundInterface(float sampling_rate, int n_channels)
Make a new sound interface.
TorcsSound * turbo_sound
turbo spinning sound
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.
TorcsSound * metal_skid_sound
metal skidding on metal
TorcsSound * backfire_loop_sound
exhaust backfire sound
TorcsSound * grass_skid_sound
skidding on dirt/grass
TorcsSound * axle_sound
axle/gear spinning sound
TorcsSound * skid_sound[4]
set of skid sounds, one per tyre
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_ride_sound
rolling on dirt/grass
TorcsSound * curb_ride_sound
rolling on curb
float sampling_rate
sampling rate
TorcsSound * crash_sound[NB_CRASH_SOUND]
list of crash sounds
TorcsSound * road_ride_sound
rolling on normal road
int n_channels
number of channels
TorcsSound * gear_change_sound
sound when changing gears
TorcsSound * bottom_crash_sound
bang when crashing from a great height
int n_engine_sounds
number of simultaneous engines
int curCrashSnd
holds current crash sound used - the sound cycles
TorcsSound * bang_sound
sounds when suspension fully compressed
virtual void setSource(sgVec3 p, sgVec3 u)
virtual void setPitch(float pitch)
Set the pitch.
virtual void setVolume(float vol)
Set the volume.
static CarSoundData ** car_sound_data
int id
The id of the car producing the sound, used for retrieving doppler effects etc.
QSoundChar CarSoundData::* schar
The calculated sound characteristic.
TorcsSound * snd
The raw sound.