source function
The element's source.
import { source } from '@dioramajs/diorama/audio/graph'The first call takes the element's sound into the graph for good (the browser allows one source per element), so the source goes to the output at once and stays connected; analysers come and go beside it.
function source(
graph: AudioContext,
media: HTMLMediaElement,
): MediaElementAudioSourceNodeParameters
| Name | Type | Description |
|---|---|---|
graph | AudioContext | |
media | HTMLMediaElement |
Also exported from @dioramajs/audio/graph.
Defined in packages/audio/src/graph.ts.