Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions resource/dist/ModelExtras.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,15 @@ TailLightShadowIntensity = 80 # Opacity of projected groun
[SOUND]
SoundEffects = 1 # Master toggle for all ModelExtras sound effects
SoundMult = 0.6 # Multiplier for ModelExtras audio effects (0.0 to 1.0)
SoundEffects_GlobalAirbreakSound = 1 # Plays engine air brake sound for big vehicles (check [TABLE])
SoundEffects_GlobalEngineSound = 1 # Plays engine on/off sound
SoundEffects_GlobalIndicatorSound = 1 # Plays indicator on/off sound
SoundEffects_GlobalReverseSound = 1 # Plays reverse sound for big vehicles (check [TABLE])
SoundEffects_NonPlayerVehicles = 1 # Plays sound effects for traffic vehicles too
GlobalAirbreakSound = 1 # Plays engine air brake sound for big vehicles (check [TABLE])
GlobalEngineSound = 1 # Plays engine on/off sound
GlobalIndicatorSound = 1 # Plays indicator on/off sound
GlobalReverseSound = 1 # Plays reverse sound for big vehicles (check [TABLE])
BrakePadSound = 0 # Plays brake pad squeak sound for automobiles when braking (check [TABLE])
BrakePadOnlySelected = 1 # Brake pad squeak for selected vehicles only (check [TABLE])
DoorChimeSound = 1 # Plays open door warning chime sound for vehicles (check [TABLE])
DoorChimeOnlySelected = 1 # Open door warning chime for selected vehicles only (check [TABLE])
NonPlayerVehicles = 1 # Plays sound effects for traffic vehicles too

[CONFIG]
ModLoaderData = 1 # Loads per-vehicle data configs (.jsonc/.json/.eml/.ivfc) directly from ModLoader subfolders
Expand All @@ -101,5 +105,8 @@ SirenLightKey = 0x4C # Toggle emergency siren lig
SpotLightKey = 0x42 # Toggle police searchlight / spotlight on / off (Default: B [0x42])

[TABLE]
SoundEffects_BigVehicleModels = "403, 406, 407, 408, 414, 416, 427, 428, 431, 433, 437, 443, 455, 456, 486, 498, 499, 508, 514, 515, 524, 525, 528, 530, 532, 544, 552, 573, 574, 578, 588, 601, 609" # Vehicle model IDs for air brake and reverse warning sounds
BigVehicleModels = "403, 406, 407, 408, 414, 416, 427, 428, 431, 433, 437, 443, 455, 456, 486, 498, 499, 508, 514, 515, 524, 525, 528, 530, 532, 544, 552, 573, 574, 578, 588, 601, 609" # Vehicle model IDs for air brake and reverse warning sounds
BackFireEffect_VehicleModels = "402, 411, 415, 424, 429, 434, 439, 451, 461, 468, 475, 477, 480, 494, 496, 502, 503, 504, 506, 521, 522, 535, 541, 558, 559, 560, 561, 562, 565, 581, 587, 589, 603, 604" # Vehicle model IDs for sports exhaust backfire flames
DoorChime_VehicleModels = "400, 401, 402, 405, 409, 410, 411, 413, 415, 416, 418, 420, 421, 422, 426, 429, 436, 440, 445, 451, 458, 459, 470, 477, 480, 482, 489, 490, 492, 496, 500, 505, 506, 507, 516, 517, 526, 527, 529, 533, 540, 541, 546, 547, 550, 551, 554, 558, 559, 560, 561, 562, 565, 579, 582, 585, 587, 589, 596, 597, 598, 599, 602, 603" # Allowed vehicle model IDs for open door warning chime sound
BrakePad_VehicleModels = "401, 404, 410, 412, 413, 418, 419, 420, 421, 422, 423, 426, 434, 436, 438, 439, 440, 442, 458, 459, 466, 467, 474, 475, 478, 479, 482, 483, 489, 491, 492, 496, 500, 504, 505, 507, 508, 516, 517, 518, 526, 527, 529, 534, 535, 536, 540, 542, 543, 545, 546, 547, 549, 550, 551, 554, 555, 565, 566, 567, 575, 576, 580, 582, 585, 589, 600, 604, 605" # Allowed vehicle model IDs for brake pad squeak sound

Binary file added resource/dist/ModelExtras/audio/brake_pad.mp3
Binary file not shown.
Binary file added resource/dist/ModelExtras/audio/door_chime.mp3
Binary file not shown.
19 changes: 19 additions & 0 deletions src/ModelExtrasAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,27 @@ bool ME_PlaySound(CVehicle *pVeh, const char *soundPath, float volume) {
void ME_StopVehicleSounds(CVehicle *pVeh) {
if (!pVeh) return;
auto &sData = SoundEffects::m_VehData.Get(pVeh);
if (sData.m_hDoorChimeStream) {
AudioMgr::StopLoopStream(sData.m_hDoorChimeStream);
sData.m_hDoorChimeStream = 0;
}
if (sData.m_hBrakePadStream) {
AudioMgr::StopLoopStream(sData.m_hBrakePadStream);
sData.m_hBrakePadStream = 0;
}
}

bool ME_IsDoorChimePlaying(CVehicle *pVeh) {
if (!pVeh) return false;
auto &sData = SoundEffects::m_VehData.Get(pVeh);
return sData.m_hDoorChimeStream != 0;
}

bool ME_IsBrakePadSqueakPlaying(CVehicle *pVeh) {
if (!pVeh) return false;
auto &sData = SoundEffects::m_VehData.Get(pVeh);
return sData.m_hBrakePadStream != 0;
}

float ME_GetBrakePressure(CVehicle *pVeh) {
if (!pVeh) return 0.0f;
Expand Down
2 changes: 2 additions & 0 deletions src/ModelExtrasAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ extern "C"
// Audio & Sounds
ME_WRAPPER bool ME_PlaySound(CVehicle *pVeh, const char *soundPath, float volume);
ME_WRAPPER void ME_StopVehicleSounds(CVehicle *pVeh);
ME_WRAPPER bool ME_IsDoorChimePlaying(CVehicle *pVeh);
ME_WRAPPER bool ME_IsBrakePadSqueakPlaying(CVehicle *pVeh);
ME_WRAPPER float ME_GetBrakePressure(CVehicle *pVeh);
ME_WRAPPER bool ME_PlayFileSound(const char *soundPath, float volume);
ME_WRAPPER void ME_PlaySwitchSound(CVehicle *pVeh);
Expand Down
Loading