Visual alerting as described in the previous post is currently working based on variable values of safety levels.
Audio alerting corresponds to the same calculations used by the visual alerts, so the foundation is already set. During class walkthroughs, a popular suggestion was to make the audio alerts optional in case they were annoying or unnecessary. To create this as an option, I have an button on my interface that will serve as a toggle. This button corresponds to an event handler that talks to two boolean variables. One boolean value indicates whether noise should be played or not, and the other signals immediate change of state so that noise will immediately stop or start as soon as the button is pressed.
The Audio alarms are referenced off of the bin\debug folder to make references self-reliant on the project folder. Two instances of the C# soundplayer are used to loop the alarm based on the current state of danger. Again, it was very important to recognize state changes during every frame iteration to make the sound function correctly.
Audio alerting corresponds to the same calculations used by the visual alerts, so the foundation is already set. During class walkthroughs, a popular suggestion was to make the audio alerts optional in case they were annoying or unnecessary. To create this as an option, I have an button on my interface that will serve as a toggle. This button corresponds to an event handler that talks to two boolean variables. One boolean value indicates whether noise should be played or not, and the other signals immediate change of state so that noise will immediately stop or start as soon as the button is pressed.
The Audio alarms are referenced off of the bin\debug folder to make references self-reliant on the project folder. Two instances of the C# soundplayer are used to loop the alarm based on the current state of danger. Again, it was very important to recognize state changes during every frame iteration to make the sound function correctly.