mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
add hydra audio capture option
This commit is contained in:
parent
de00212bb6
commit
66fd20ace5
@ -12,6 +12,13 @@ await initHydra();
|
||||
|
||||
Then you can use hydra below!
|
||||
|
||||
### Enable audio capture
|
||||
Use `{audio: true}` param to enable Hydra's audio capture:
|
||||
|
||||
```js
|
||||
await initHydra({audio: true});
|
||||
```
|
||||
|
||||
## Usage via npm
|
||||
|
||||
```sh
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { getDrawContext } from '@strudel.cycles/core';
|
||||
|
||||
export async function initHydra() {
|
||||
export async function initHydra(config) {
|
||||
if (!document.getElementById('hydra-canvas')) {
|
||||
const { canvas: testCanvas } = getDrawContext();
|
||||
await import('https://unpkg.com/hydra-synth');
|
||||
h = new Hydra({detectAudio: false });
|
||||
h = new Hydra({detectAudio: config?.audio });
|
||||
h.canvas.id = 'hydra-canvas';
|
||||
h.canvas.style.position = 'absolute';
|
||||
h.canvas.style.top = '0px';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user