PaulStoffregen / Audio

Teensy Audio Library
http://www.pjrc.com/teensy/td_libs_Audio.html
1.1k stars 408 forks source link

Fix minor issue with AudioEffectEnvelope::release #442

Closed h4yn0nnym0u5e closed 2 years ago

h4yn0nnym0u5e commented 2 years ago

As discussed in forum thread https://forum.pjrc.com/threads/70856-Error-Using-Audio-Library-Envelope-Object, calling AudioEffectEnvelope::release() with a zero parameter gave a compiler error, because it could be a call to AudioStream::release() with a NULL buffer pointer. Ideally the user should of course follow the documentation and only pass a float parameter to AudioEffectEnvelope::release() ... but we don't live in an ideal world, do we?

Attached .txt file is actually a .ino (which github refuses to allow...): throws a compile error at line 49 with the old library, and works as intended with this change applied.

TestEnvelope.txt