From 972be000c8c284fdb93deaff3f1950725f96a448 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Fri, 1 Oct 2021 10:53:48 +0200 Subject: [PATCH] Updated playground --- packages/playground/src/audio/index.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/playground/src/audio/index.ts b/packages/playground/src/audio/index.ts index 504025e..422050c 100644 --- a/packages/playground/src/audio/index.ts +++ b/packages/playground/src/audio/index.ts @@ -13,13 +13,17 @@ setTimeout(async () => { // d.resolve(null) // }) // await d.promise - await sheet.sequence - .attachAudio({ - source: 'http://localhost:5000/Kai%20Engel%20-%20Moonlight%20Reprise.mp3', - }) - .then(() => { - console.log('ready') - }) + const {gainNode, audioContext} = await sheet.sequence.attachAudio({ + source: 'http://localhost:5000/audio.mp3', + }) + + const lowerGain = audioContext.createGain() + gainNode.disconnect() + gainNode.connect(lowerGain) + + lowerGain.gain.setValueAtTime(0.01, audioContext.currentTime) + lowerGain.connect(audioContext.destination) + sheet.sequence.position = 11 await sheet.sequence.play({ iterationCount: 4,