# source

function in `@dioramajs/diorama/audio/graph`

```ts
import { source } from '@dioramajs/diorama/audio/graph'
```

The element's source. 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.

```ts
function source(
  graph: AudioContext,
  media: HTMLMediaElement,
): MediaElementAudioSourceNode
```

| Parameter | Type | Description |
| --- | --- | --- |
| `graph` | `AudioContext` |  |
| `media` | `HTMLMediaElement` |  |

Also exported from `@dioramajs/audio/graph`.

Defined in [packages/audio/src/graph.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/audio/src/graph.ts#L117).
