---
title: "init(id:songTitle:artistName:albumName:type:duration:artwork:)"
framework: nowplaying
role: symbol
role_heading: Initializer
path: "nowplaying/musiccontent/init(id:songtitle:artistname:albumname:type:duration:artwork:)"
---

# init(id:songTitle:artistName:albumName:type:duration:artwork:)

Creates music content with the specified metadata.

## Declaration

```swift
init(id: String, songTitle: String, artistName: String, albumName: String, type: MediaType, duration: MediaDuration?, artwork: Artwork?)
```

## Parameters

- `id`: A unique identifier for this track.
- `songTitle`: The song’s display title.
- `artistName`: The name of the artist or performer.
- `albumName`: The album this track belongs to.
- `type`: The media type.
- `duration`: The total duration of the track, or nil when unknown.
- `artwork`: Album artwork for the track, or nil when unavailable.
