# Spectrum

Frequency bars, from bass on the left to treble on the right, moving with the track.

```bash
npx shadcn add https://www.reelcn.dev/r/spectrum.json
```

Usage:

```tsx
<Spectrum src={staticFile("track.mp3")} bars={48} />
```

Use for:

- Music clips and visualisers
- Any scene that should feel driven by the track

Avoid:

- Speech, where a waveform reads better. Use `waveform`

Dependencies:

- `@remotion/media-utils`
- `remotion`


## Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| src | `string` | — | Audio file; `staticFile("…")` or a URL. |
| bars? | `number` | `48` | Bars across the width. Rounded up to a power of two internally. |
| height? | `number` | `260` |  |
| color? | `string` | — |  |
| toColor? | `string` | — | Second color; bars blend from `color` to this across the width. |
| windowInSeconds? | `number` | `10` |  |
| style? | `CSSProperties` | — |  |
| className? | `string` | — |  |