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.
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