You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
Changed volume setting back to account for 3DLevel < 1 making automatic attenuation not work. Also made it mute when set to 0 so it won't screw things up
Changed soundcontainer playing in audioman.cpp to do panning and positioning properly, fixed audioman 3d effects handling to deal with volume setting when needed
Cleaned up some stuff in audioman
Copy file name to clipboardExpand all lines: Entities/SoundContainer.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -323,7 +323,7 @@ namespace RTE {
323
323
/// Sets the volume sounds in this SoundContainer should be played at. Note that this does not factor volume changes due to the SoundContainer's position. Does not affect currently playing sounds.
324
324
/// </summary>
325
325
/// <param name="newVolume">The new volume sounds in this SoundContainer should be played at. Limited between 0 and 10.</param>
if (!soundContainer->IsImmobile()) { UpdatePositionalEffectsForSoundChannel(channel); }
519
522
520
523
if (result != FMOD_OK) {
521
524
g_ConsoleMan.PrintString("ERROR: Could not play sounds from SoundContainer " + soundContainer->GetPresetName() + ": " + std::string(FMOD_ErrorString(result)));
result = m_AudioSystem->getChannel(channelIndex, &soundChannel);
581
-
result = result == FMOD_OK ? soundChannel->setVolume(soundContainer->GetVolume()) : result;
586
+
result = result == FMOD_OK ? soundChannel->getVolume(&soundChannelCurrentVolume) : result;
587
+
588
+
if (newVolume == 0.0F) {
589
+
result = result == FMOD_OK ? soundChannel->setMute(true) : result;
590
+
result = result == FMOD_OK ? soundChannel->setVolume(soundChannelCurrentVolume / soundContainerOldVolume) : result;
591
+
} else {
592
+
result = result == FMOD_OK ? soundChannel->setMute(false) : result;
593
+
result = result == FMOD_OK ? soundChannel->setVolume(newVolume / soundContainerOldVolume * soundChannelCurrentVolume) : result;
594
+
}
582
595
if (result != FMOD_OK) {
583
596
g_ConsoleMan.PrintString("ERROR: Could not update sound volume for the sound being played on channel " + std::to_string(channelIndex) + " for SoundContainer " + soundContainer->GetPresetName() + ": " + std::string(FMOD_ErrorString(result)));
g_ConsoleMan.PrintString("ERROR: An error occurred when checking to see if the sound at channel " + std::to_string(soundChannelIndex) + " was less than its minimum audible distance away from the farthest listener.");
0 commit comments