08-17-2022, 02:19 PM
Do you guys know anything about Greek/Roman mythology? Have you read "The Oddysey" English translation?
Kidding aside...
The sound has to be faded away after the user presses escape. If you decided to sound longer for three seconds before closing the program, then you have to figure out for three seconds how to make the sound silent. This means make the code just like the regular loop but, only for the length of time chosen (three seconds in this case), make a multiplication on the sample frame.
The following line could produce trouble:
_SndRaw Amplitude * Waveform
If that is computed to an absolute value greater than one, it's going to cause digital distortion. Check the code to make sure that value doesn't run out of control away from the range of -1.0 to 1.0.
Kidding aside...
The sound has to be faded away after the user presses escape. If you decided to sound longer for three seconds before closing the program, then you have to figure out for three seconds how to make the sound silent. This means make the code just like the regular loop but, only for the length of time chosen (three seconds in this case), make a multiplication on the sample frame.
The following line could produce trouble:
_SndRaw Amplitude * Waveform
If that is computed to an absolute value greater than one, it's going to cause digital distortion. Check the code to make sure that value doesn't run out of control away from the range of -1.0 to 1.0.