nativeformat / NFPlayerJS

A JavaScript/TypeScript audio engine for the Web and Server capable of multitrack time stretching, pitch shifting, declarative effects, faster than realtime processing, and more!
https://nativeformat.github.io/NFPlayerJS
Apache License 2.0
130 stars 9 forks source link

Maximum values for Params #1

Open kirbysayshi opened 5 years ago

kirbysayshi commented 5 years ago

There is no definition of a max audio param value, which in the case of the stretch node could cause an out of memory condition. For example, set a stretch value of something very high, but still a valid number, such as 99999. The system will attempt to allocate a buffer large enough to accommodate, and likely crash.

This is not an issue if the Scores are controlled by the author, as it's basically the same risks as running untrusted JS.

But it would be nice to provide reasonable maximum values, and warn (console.warn?) the user of a possible error situation.