Skip to content

Commit

Permalink
added genre codes 148 to 191 (winamp ext) (#103)
Browse files Browse the repository at this point in the history
* added genre codes 148 to 191 (winamp ext)
* make new genres captialization consistent with existing
* removed hyphen from Indie-Rock genre
  • Loading branch information
bretttolbert authored Jan 22, 2024
1 parent 978a092 commit 0253fc5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions id3v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
"strings"
)

// Genre definitions 0-79 follow the ID3 tag specification of 1999.
// More genres have been successively introduced in later Winamp versions.
// https://en.wikipedia.org/wiki/List_of_ID3v1_genres#Extension_by_Winamp
var id3v2Genres = [...]string{
"Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge",
"Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B",
Expand Down Expand Up @@ -41,6 +44,14 @@ var id3v2Genres = [...]string{
"Heavy Metal", "Black Metal", "Crossover", "Contemporary Christian",
"Christian Rock ", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop",
"Synthpop",
"Christmas", "Art Rock", "Baroque", "Bhangra", "Big Beat", "Breakbeat",
"Chillout", "Downtempo", "Dub", "EBM", "Eclectic", "Electro",
"Electroclash", "Emo", "Experimental", "Garage", "Global", "IDM",
"Illbient", "Industro-Goth", "Jam Band", "Krautrock", "Leftfield", "Lounge",
"Math Rock", "New Romantic", "Nu-Breakz", "Post-Punk", "Post-Rock", "Psytrance",
"Shoegaze", "Space Rock", "Trop Rock", "World Music", "Neoclassical", "Audiobook",
"Audio Theatre", "Neue Deutsche Welle", "Podcast", "Indie Rock", "G-Funk", "Dubstep",
"Garage Rock", "Psybient",
}

// id3v2Header is a type which represents an ID3v2 tag header.
Expand Down
3 changes: 3 additions & 0 deletions id3v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ func TestGenreExpension(t *testing.T) {
"Test (17)": "Test Rock",
"(17)(93)": "Rock Psychedelic Rock",
"(17)Test(93)": "Rock Test Psychedelic Rock",
"(175)": "Post-Punk",
"(187)": "Indie Rock",
"(191)": "Psybient",
}
for g, r := range tests {
got := id3v2genre(g)
Expand Down

0 comments on commit 0253fc5

Please sign in to comment.