Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5d69f99

Browse files
author
Thomas Dodds
committed
version bump to v2.7.5
1 parent 0e6cdb4 commit 5d69f99

File tree

7 files changed

+45
-15
lines changed

7 files changed

+45
-15
lines changed

‎dist/Superpowered.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class LinearMemoryBuffer {
3131
}
3232

3333
class SuperpoweredGlue {
34-
static wasmCDNUrl = 'https://cdn.jsdelivr.net/npm/@superpoweredsdk/web@2.7.4/dist/superpowered-npm.wasm';
34+
static wasmCDNUrl = 'https://cdn.jsdelivr.net/npm/@superpoweredsdk/web@2.7.5/dist/superpowered-npm.wasm';
3535

3636
/**@type {number}*/id = Math.floor(Math.random() * Date.now());
3737
/**@type {ArrayBuffer}*/linearMemory;
@@ -584,10 +584,16 @@ class SuperpoweredWebAudio {
584584
/**@type {object} */Superpowered;
585585
/**@type {AudioContext} */audioContext;
586586

587-
constructor(/**@type {number}*/minimumSamplerate, /**@type {object}*/superpowered) {
587+
constructor(/**@type {number}*/minimumSamplerate, /**@type {object}*/superpowered,/**@type {AudioContext}*/audioContext) {
588588
this.Superpowered = superpowered;
589-
this.audioContext = new AudioContext();
589+
if (audioContext && !(audioContext instanceof AudioContext)) {
590+
throw new Error('Invalid AudioContext provided to SuperpoweredWebAudio constructor.');
591+
}
592+
this.audioContext = audioContext ?? new AudioContext();
590593
if (this.audioContext.sampleRate < minimumSamplerate) {
594+
if (audioContext) {
595+
throw new Error(`The provided AudioContext has a sample rate of ${this.audioContext.sampleRate}, but the minimum required sample rate is ${minimumSamplerate}.`);
596+
}
591597
this.audioContext.close();
592598
this.audioContext = new AudioContext({ sampleRate: minimumSamplerate });
593599
}

‎dist/superpowered-npm.wasm

908 Bytes
Binary file not shown.

‎dist/superpowered.wasm

908 Bytes
Binary file not shown.

‎examples/example_effects/Superpowered.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class LinearMemoryBuffer {
3131
}
3232

3333
class SuperpoweredGlue {
34-
static wasmCDNUrl = 'https://cdn.jsdelivr.net/npm/@superpoweredsdk/web@2.7.4/dist/superpowered-npm.wasm';
34+
static wasmCDNUrl = 'https://cdn.jsdelivr.net/npm/@superpoweredsdk/web@2.7.5/dist/superpowered-npm.wasm';
3535

3636
/**@type {number}*/id = Math.floor(Math.random() * Date.now());
3737
/**@type {ArrayBuffer}*/linearMemory;
@@ -584,10 +584,16 @@ class SuperpoweredWebAudio {
584584
/**@type {object} */Superpowered;
585585
/**@type {AudioContext} */audioContext;
586586

587-
constructor(/**@type {number}*/minimumSamplerate, /**@type {object}*/superpowered) {
587+
constructor(/**@type {number}*/minimumSamplerate, /**@type {object}*/superpowered,/**@type {AudioContext}*/audioContext) {
588588
this.Superpowered = superpowered;
589-
this.audioContext = new AudioContext();
589+
if (audioContext && !(audioContext instanceof AudioContext)) {
590+
throw new Error('Invalid AudioContext provided to SuperpoweredWebAudio constructor.');
591+
}
592+
this.audioContext = audioContext ?? new AudioContext();
590593
if (this.audioContext.sampleRate < minimumSamplerate) {
594+
if (audioContext) {
595+
throw new Error(`The provided AudioContext has a sample rate of ${this.audioContext.sampleRate}, but the minimum required sample rate is ${minimumSamplerate}.`);
596+
}
591597
this.audioContext.close();
592598
this.audioContext = new AudioContext({ sampleRate: minimumSamplerate });
593599
}

‎examples/example_guitardistortion/Superpowered.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class LinearMemoryBuffer {
3131
}
3232

3333
class SuperpoweredGlue {
34-
static wasmCDNUrl = 'https://cdn.jsdelivr.net/npm/@superpoweredsdk/web@2.7.4/dist/superpowered-npm.wasm';
34+
static wasmCDNUrl = 'https://cdn.jsdelivr.net/npm/@superpoweredsdk/web@2.7.5/dist/superpowered-npm.wasm';
3535

3636
/**@type {number}*/id = Math.floor(Math.random() * Date.now());
3737
/**@type {ArrayBuffer}*/linearMemory;
@@ -584,10 +584,16 @@ class SuperpoweredWebAudio {
584584
/**@type {object} */Superpowered;
585585
/**@type {AudioContext} */audioContext;
586586

587-
constructor(/**@type {number}*/minimumSamplerate, /**@type {object}*/superpowered) {
587+
constructor(/**@type {number}*/minimumSamplerate, /**@type {object}*/superpowered,/**@type {AudioContext}*/audioContext) {
588588
this.Superpowered = superpowered;
589-
this.audioContext = new AudioContext();
589+
if (audioContext && !(audioContext instanceof AudioContext)) {
590+
throw new Error('Invalid AudioContext provided to SuperpoweredWebAudio constructor.');
591+
}
592+
this.audioContext = audioContext ?? new AudioContext();
590593
if (this.audioContext.sampleRate < minimumSamplerate) {
594+
if (audioContext) {
595+
throw new Error(`The provided AudioContext has a sample rate of ${this.audioContext.sampleRate}, but the minimum required sample rate is ${minimumSamplerate}.`);
596+
}
591597
this.audioContext.close();
592598
this.audioContext = new AudioContext({ sampleRate: minimumSamplerate });
593599
}

‎examples/example_pitchbend/Superpowered.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class LinearMemoryBuffer {
3131
}
3232

3333
class SuperpoweredGlue {
34-
static wasmCDNUrl = 'https://cdn.jsdelivr.net/npm/@superpoweredsdk/web@2.7.4/dist/superpowered-npm.wasm';
34+
static wasmCDNUrl = 'https://cdn.jsdelivr.net/npm/@superpoweredsdk/web@2.7.5/dist/superpowered-npm.wasm';
3535

3636
/**@type {number}*/id = Math.floor(Math.random() * Date.now());
3737
/**@type {ArrayBuffer}*/linearMemory;
@@ -584,10 +584,16 @@ class SuperpoweredWebAudio {
584584
/**@type {object} */Superpowered;
585585
/**@type {AudioContext} */audioContext;
586586

587-
constructor(/**@type {number}*/minimumSamplerate, /**@type {object}*/superpowered) {
587+
constructor(/**@type {number}*/minimumSamplerate, /**@type {object}*/superpowered,/**@type {AudioContext}*/audioContext) {
588588
this.Superpowered = superpowered;
589-
this.audioContext = new AudioContext();
589+
if (audioContext && !(audioContext instanceof AudioContext)) {
590+
throw new Error('Invalid AudioContext provided to SuperpoweredWebAudio constructor.');
591+
}
592+
this.audioContext = audioContext ?? new AudioContext();
590593
if (this.audioContext.sampleRate < minimumSamplerate) {
594+
if (audioContext) {
595+
throw new Error(`The provided AudioContext has a sample rate of ${this.audioContext.sampleRate}, but the minimum required sample rate is ${minimumSamplerate}.`);
596+
}
591597
this.audioContext.close();
592598
this.audioContext = new AudioContext({ sampleRate: minimumSamplerate });
593599
}

‎examples/example_timestretching/Superpowered.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class LinearMemoryBuffer {
3131
}
3232

3333
class SuperpoweredGlue {
34-
static wasmCDNUrl = 'https://cdn.jsdelivr.net/npm/@superpoweredsdk/web@2.7.4/dist/superpowered-npm.wasm';
34+
static wasmCDNUrl = 'https://cdn.jsdelivr.net/npm/@superpoweredsdk/web@2.7.5/dist/superpowered-npm.wasm';
3535

3636
/**@type {number}*/id = Math.floor(Math.random() * Date.now());
3737
/**@type {ArrayBuffer}*/linearMemory;
@@ -584,10 +584,16 @@ class SuperpoweredWebAudio {
584584
/**@type {object} */Superpowered;
585585
/**@type {AudioContext} */audioContext;
586586

587-
constructor(/**@type {number}*/minimumSamplerate, /**@type {object}*/superpowered) {
587+
constructor(/**@type {number}*/minimumSamplerate, /**@type {object}*/superpowered,/**@type {AudioContext}*/audioContext) {
588588
this.Superpowered = superpowered;
589-
this.audioContext = new AudioContext();
589+
if (audioContext && !(audioContext instanceof AudioContext)) {
590+
throw new Error('Invalid AudioContext provided to SuperpoweredWebAudio constructor.');
591+
}
592+
this.audioContext = audioContext ?? new AudioContext();
590593
if (this.audioContext.sampleRate < minimumSamplerate) {
594+
if (audioContext) {
595+
throw new Error(`The provided AudioContext has a sample rate of ${this.audioContext.sampleRate}, but the minimum required sample rate is ${minimumSamplerate}.`);
596+
}
591597
this.audioContext.close();
592598
this.audioContext = new AudioContext({ sampleRate: minimumSamplerate });
593599
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /