DirectSound Environmental Audio

Reporter: RobertBColton  |  Status: open  |  Last Modified: November 19, 2020, 01:33:40 PM

Well, here it is, ENIGMA can finally support environmental audio thanks to all the hard work of our Virtual Reality buddies.

  • Fix memory leak on reference-counted COM interfaces by using ComPtr
  • Fix memory leak in sound_effect_set by deleting the dynamically allocated effect description arrays
  • Implement all sound effect parameter functions using a generic templated helper
// create event
effect = se_none;

// step event
if (keyboard_check_released(ord('0')))
	effect = se_none;
if (keyboard_check_released(ord('1')))
	effect ^= se_chorus;
if (keyboard_check_released(ord('2')))
	effect ^= se_echo;
if (keyboard_check_released(ord('3')))
	effect ^= se_flanger;
if (keyboard_check_released(ord('4')))
	effect ^= se_gargle;
if (keyboard_check_released(ord('5')))
	effect ^= se_reverb;
if (keyboard_check_released(ord('6')))
	effect ^= se_compressor;
if (keyboard_check_released(ord('7')))
	effect ^= se_equalizer;
if (keyboard_check_released(vk_anykey))
	sound_effect_set(snd_0,effect);
if (keyboard_check_released(vk_space))
	sound_play(snd_0);

// draw event
if (effect & se_chorus)
	draw_text(0, 0, "Chorus");
if (effect & se_echo)
	draw_text(0, 20, "Echo");
if (effect & se_flanger)
	draw_text(0, 40, "Flanger");
if (effect & se_gargle)
	draw_text(0, 60, "Gargle");
if (effect & se_reverb)
	draw_text(0, 80, "Reverb");
if (effect & se_compressor)
	draw_text(0, 100, "Compressor");
if (effect & se_equalizer)
	draw_text(0, 120, "Equalizer");
codecov[bot]  
>Codecov Report

Merging #2166 (aa694a5) into master (707282b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2166   +/-   ##
=======================================
  Coverage   33.03%   33.03%           
=======================================
  Files         197      197           
  Lines       19059    19059           
=======================================
  Hits         6296     6296           
  Misses      12763    12763           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 707282b...aa694a5. Read the comment docs.

Please sign in to post comments, or you can view this issue on GitHub.