fix: make sure ac is defined
This commit is contained in:
parent
f558b4b8f6
commit
63ee218d53
1 changed files with 1 additions and 1 deletions
|
|
@ -314,6 +314,7 @@ export function resetGlobalEffects() {
|
|||
}
|
||||
|
||||
export const superdough = async (value, t, hapDuration) => {
|
||||
const ac = getAudioContext();
|
||||
t = typeof t === 'string' && t.startsWith('=') ? Number(t.slice(1)) : ac.currentTime + t;
|
||||
let { stretch } = value;
|
||||
if (stretch != null) {
|
||||
|
|
@ -321,7 +322,6 @@ export const superdough = async (value, t, hapDuration) => {
|
|||
const latency = 0.04;
|
||||
t = t - latency;
|
||||
}
|
||||
const ac = getAudioContext();
|
||||
if (typeof value !== 'object') {
|
||||
throw new Error(
|
||||
`expected hap.value to be an object, but got "${value}". Hint: append .note() or .s() to the end`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue