# Class: Id3v2

## jala.Mp3.Id3v2(mp3File)

This class represents an Id3v2 tag.

## Constructor

#### new Id3v2(mp3File)

Constructs a new Id3v2 tag from an Mp3 file

##### Parameters:

Name | Type | Description
--- | --- | ---
`mp3File` | jala.Mp3 |

Source:
  - jala/code/Mp3.js, line 955

### Methods

#### copyFrom(src)

Copies standard fields from another tag.

##### Parameters:

Name | Type | Description
--- | --- | ---
`src` | Object | object with getter methods for fields album, artist, comment, title, trackNumber, genre and year.

Source:
  - jala/code/Mp3.js, line 1026

#### getAlbum()

Returns the album information of the tag.

Source:
  - jala/code/Mp3.js, line 1195

##### Returns:

string containing album name

#### getArtist()

Returns the artist information of the tag.

Source:
  - jala/code/Mp3.js, line 1205

##### Returns:

string containing artist name

#### getAudio()

Returns the wrapper for the underlying audio file.

Source:
  - jala/code/Mp3.js, line 967

#### getAuthor()

Returns the author information of the tag.

Source:
  - jala/code/Mp3.js, line 1280

##### Returns:

string containing author information

#### getComment()

Returns the comment information of the tag.

Source:
  - jala/code/Mp3.js, line 1215

##### Returns:

string containing comment

#### getCopyright()

Returns the copyright information of the tag.

Source:
  - jala/code/Mp3.js, line 1290

##### Returns:

The copyright information of the tag

#### getGenre()

Returns the genre information of the tag.

Source:
  - jala/code/Mp3.js, line 1260

##### Returns:

string containing genre name

#### getImage(pictureType)

Extracts the image from the tag

##### Parameters:

Name | Type | Description
--- | --- | ---
`pictureType` | String | number describing picture type (default is 3, describing a front cover).

Source:
  - jala/code/Mp3.js, line 1446

##### Returns:

image as mime object

#### getJavaObject()

returns the java representation of the tag, class depends on the actual library used.

Source:
  - jala/code/Mp3.js, line 976

#### getSubtitle()

Returns the subtitle information of the tag.

Source:
  - jala/code/Mp3.js, line 1240

##### Returns:

string containing subtitle

#### getSubtype()

Returns the version number of this id3v2 (values 2 to 4 for id3v2.2 to id3v2.4)

Source:
  - jala/code/Mp3.js, line 1174

##### Returns:

The version number of this Id3v2 tag

#### getTextContent(id)

This method can be used to retrieve an arbitrary text frame of the underlying tag. For the list of valid identifiers and their meaning see http://www.id3.org/ The identifiers vary across the sub versions of id3v2 tags, use getSubtype to make sure you use the correct version.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | Frame identifier according to Id3v2 specification or shortcut as defined in jala.Mp3.FIELD_MAPPING.

Source:
  - jala/code/Mp3.js, line 1101
See:
  - #getSubtype

##### Returns:

String contained in the frame

#### getTextEncoding()

Returns the text encoding used when setting values.

Source:
  - jala/code/Mp3.js, line 1013

##### Returns:

The text encoding

#### getTitle()

Returns the title information of the tag.

Source:
  - jala/code/Mp3.js, line 1230

##### Returns:

string containing title

#### getTrackNumber()

Returns the track number information of the tag.

Source:
  - jala/code/Mp3.js, line 1250

##### Returns:

string representing track number

#### getUrl()

Returns the Url stored in this tag

Source:
  - jala/code/Mp3.js, line 1300

##### Returns:

The url stored in this tag

#### getYear()

Returns the year information of the tag.

Source:
  - jala/code/Mp3.js, line 1270

##### Returns:

string representing year

#### removeFromAudio()

Removes the tag from the audio file and nulls out the wrapper.

Source:
  - jala/code/Mp3.js, line 984

#### setAlbum(album)

Sets the album information.

##### Parameters:

Name | Type | Description
--- | --- | ---
`album` | String |

Source:
  - jala/code/Mp3.js, line 1313

#### setArtist(artist)

Sets the artist information.

##### Parameters:

Name | Type | Description
--- | --- | ---
`artist` | String |

Source:
  - jala/code/Mp3.js, line 1323

#### setAuthor(author)

Sets the author information in this tag

##### Parameters:

Name | Type | Description
--- | --- | ---
`author` | String | The author information to set

Source:
  - jala/code/Mp3.js, line 1404

#### setComment(comment)

Sets the comment

##### Parameters:

Name | Type | Description
--- | --- | ---
`comment` | String |

Source:
  - jala/code/Mp3.js, line 1333

#### setCopyright(copyright)

Sets the copyright information in this tag

##### Parameters:

Name | Type | Description
--- | --- | ---
`copyright` | String | The copyright information to set

Source:
  - jala/code/Mp3.js, line 1414

#### setGenre(genre)

Sets the genre information. A list of genre names that are compatible with ID3v1 tags is located in jala.Mp3.GENRES.

##### Parameters:

Name | Type | Description
--- | --- | ---
`genre` | String |

Source:
  - jala/code/Mp3.js, line 1384

#### setImage(pictureType, mimeType, byteArray, desc)

adds an image to the file.

##### Parameters:

Name | Type | Description
--- | --- | ---
`pictureType` | Number | number determining picture type
`mimeType` | String | mime type of image
`byteArray` | Array | image binary data
`desc` | String | optional description

Source:
  - jala/code/Mp3.js, line 1476
See:
  - jala.Mp3

#### setSubtitle(title)

Sets the subtitle information

##### Parameters:

Name | Type | Description
--- | --- | ---
`title` | String |

Source:
  - jala/code/Mp3.js, line 1363

#### setTextContent(id, value)

This method can be used to set an arbitrary field of the underlying tag. For the list of valid identifiers and their meaning see http://www.id3.org/ The identifiers vary across the sub versions of id3v2 tags, use getSubtype to make sure you use the correct version.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | Frame identifier according to Id3v2 specification
`value` | String |

Source:
  - jala/code/Mp3.js, line 1128
See:
  - #getSubtype

#### setTextEncoding(encType)

sets the text encoding used when creating new frames (the encoding type of old frames can't be changed with JavaMusicTag)

##### Parameters:

Name | Type | Description
--- | --- | ---
`encType` | Number | String | the new encoding type as number or string

Source:
  - jala/code/Mp3.js, line 1003
See:
  - jala.Mp3#TEXT_ENCODINGS

#### setTitle(title)

Sets the title information

##### Parameters:

Name | Type | Description
--- | --- | ---
`title` | String |

Source:
  - jala/code/Mp3.js, line 1353

#### setTrackNumber(trackNumber)

Sets the track number information.

##### Parameters:

Name | Type | Description
--- | --- | ---
`trackNumber` | Number |

Source:
  - jala/code/Mp3.js, line 1373

#### setUrl(url, desc)

Stores the Url passed as argument in this tag.

##### Parameters:

Name | Type | Description
--- | --- | ---
`url` | String | The url to store in this tag
`desc` | String | An optiona description of the Url

Source:
  - jala/code/Mp3.js, line 1425

#### setYear(year)

Sets the year information.

##### Parameters:

Name | Type | Description
--- | --- | ---
`year` | Number |

Source:
  - jala/code/Mp3.js, line 1394