# Sandbox.Game.Music.Play

## Overload 1

```csharp
static void Play(SoundFile track, float fade = 1, bool loop = True, float volume = 1)
```

Play a track. Whatever is playing fades out over `fade` seconds while this fades in.
`volume` is for this track only, on top of [Sandbox.Game.Music.Volume](/api/Sandbox.Game.Music/Volume) - use it to tame a loud file.
Looping is gapless if the sound has loop points (tick Loop in the sound editor), otherwise the track
restarts when it ends. Playing the track that's already playing updates its volume without restarting it.

### Parameters

- `track` (`SoundFile`)
- `fade` (`float`), default `1`
- `loop` (`bool`), default `True`
- `volume` (`float`), default `1`

## Overload 2

```csharp
static void Play(string path, float fade = 1, bool loop = True, float volume = 1)
```

Play a track by path, e.g. "music/theme.mp3". See [Sandbox.Game.Music.Play](/api/Sandbox.Game.Music/Play).

### Parameters

- `path` (`string`)
- `fade` (`float`), default `1`
- `loop` (`bool`), default `True`
- `volume` (`float`), default `1`

Declared in [Sandbox.Game.Music](/api/Sandbox.Game.Music).
Assembly: `Sandbox.Engine`.
