TCON
extends TextFrame
in package
TCON frame - Content type (genre).
The 'Content type' frame represents the genre of the audio file. In ID3v1, this was a numeric value, but in ID3v2 it can be any string. For backward compatibility, the ID3v1 genres can be used by enclosing the genre number in parentheses, e.g. "(4)" for "Disco".
Table of Contents
Properties
- $genres : array<string|int, string>
- The list of ID3v1 genres.
- $encoding : int
- $frameId : string
- $text : string
Methods
- __construct() : mixed
- Constructs the TCON frame with given parameters.
- getEncoding() : int
- Returns the text encoding.
- getGenre() : string
- Returns the genre.
- getText() : string
- Returns the text content.
- parse() : self
- Parses the frame data.
- setEncoding() : self
- Sets the text encoding.
- setGenre() : self
- Sets the genre.
- setGenreById() : self
- Sets the genre by ID3v1 genre ID.
- setText() : self
- Sets the text content.
- toBytes() : string
- Converts the frame to binary data.
Properties
$genres
The list of ID3v1 genres.
public
static array<string|int, string>
$genres
= ['Blues', 'Classic Rock', 'Country', 'Dance', 'Disco', 'Funk', 'Grunge', 'Hip-Hop', 'Jazz', 'Metal', 'New Age', 'Oldies', 'Other', 'Pop', 'R&B', 'Rap', 'Reggae', 'Rock', 'Techno', 'Industrial', 'Alternative', 'Ska', 'Death Metal', 'Pranks', 'Soundtrack', 'Euro-Techno', 'Ambient', 'Trip-Hop', 'Vocal', 'Jazz+Funk', 'Fusion', 'Trance', 'Classical', 'Instrumental', 'Acid', 'House', 'Game', 'Sound Clip', 'Gospel', 'Noise', 'AlternRock', 'Bass', 'Soul', 'Punk', 'Space', 'Meditative', 'Instrumental Pop', 'Instrumental Rock', 'Ethnic', 'Gothic', 'Darkwave', 'Techno-Industrial', 'Electronic', 'Pop-Folk', 'Eurodance', 'Dream', 'Southern Rock', 'Comedy', 'Cult', 'Gangsta', 'Top 40', 'Christian Rap', 'Pop/Funk', 'Jungle', 'Native American', 'Cabaret', 'New Wave', 'Psychadelic', 'Rave', 'Showtunes', 'Trailer', 'Lo-Fi', 'Tribal', 'Acid Punk', 'Acid Jazz', 'Polka', 'Retro', 'Musical', 'Rock & Roll', 'Hard Rock', 'Folk', 'Folk-Rock', 'National Folk', 'Swing', 'Fast Fusion', 'Bebob', 'Latin', 'Revival', 'Celtic', 'Bluegrass', 'Avantgarde', 'Gothic Rock', 'Progressive Rock', 'Psychedelic Rock', 'Symphonic Rock', 'Slow Rock', 'Big Band', 'Chorus', 'Easy Listening', 'Acoustic', 'Humour', 'Speech', 'Chanson', 'Opera', 'Chamber Music', 'Sonata', 'Symphony', 'Booty Bass', 'Primus', 'Porn Groove', 'Satire', 'Slow Jam', 'Club', 'Tango', 'Samba', 'Folklore', 'Ballad', 'Power Ballad', 'Rhythmic Soul', 'Freestyle', 'Duet', 'Punk Rock', 'Drum Solo', 'A capella', 'Euro-House', 'Dance Hall']
$encoding
protected
int
$encoding
= Encoding::UTF8
$frameId
protected
string
$frameId
Hooks
protected
string
get
$text
protected
string
$text
= ''
Methods
__construct()
Constructs the TCON frame with given parameters.
public
__construct([string $genre = '' ][, int $encoding = Encoding::UTF8 ]) : mixed
Parameters
- $genre : string = ''
-
The genre
- $encoding : int = Encoding::UTF8
-
The text encoding
getEncoding()
Returns the text encoding.
public
getEncoding() : int
Return values
intgetGenre()
Returns the genre.
public
getGenre() : string
Return values
stringgetText()
Returns the text content.
public
getText() : string
Return values
stringparse()
Parses the frame data.
public
parse(string $frameData) : self
Parameters
- $frameData : string
Return values
selfsetEncoding()
Sets the text encoding.
public
setEncoding(int $encoding) : self
Parameters
- $encoding : int
Return values
selfsetGenre()
Sets the genre.
public
setGenre(string $genre) : self
Parameters
- $genre : string
-
The genre
Return values
selfsetGenreById()
Sets the genre by ID3v1 genre ID.
public
setGenreById(int $genreId) : self
Parameters
- $genreId : int
-
The genre ID
Return values
selfsetText()
Sets the text content.
public
setText(string $text) : self
Parameters
- $text : string
Return values
selftoBytes()
Converts the frame to binary data.
public
toBytes() : string