Skip to content

Commit

Permalink
fix(StandardVirtualAudioNode): do not call audio param methods if the…
Browse files Browse the repository at this point in the history
… parameters have not changed (fixes #43)
  • Loading branch information
benji6 committed May 9, 2019
1 parent 149d412 commit 761c529
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/VirtualAudioNodes/StandardVirtualAudioNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,10 @@ export default class StandardVirtualAudioNode {
for (const key of Object.keys(params)) {
if (constructorParamsKeys.indexOf(key) !== -1) continue
const param = params[key]
if (this.params && this.params[key] === param) continue
if (this.params && equals(this.params[key], param)) continue
if (audioParamProperties.indexOf(key) !== -1) {
if (Array.isArray(param)) {
if (this.params && !equals(param, this.params[key])) {
audioNode[key].cancelScheduledValues(0)
}
if (this.params) audioNode[key].cancelScheduledValues(0)
const callMethod = ([methodName, ...args]: [string, ...any[]]) =>
audioNode[key][methodName](...args)
Array.isArray(param[0])
Expand Down

0 comments on commit 761c529

Please sign in to comment.