Can't get genre

The place for "I can't figure out how to..." questions.
Post Reply
transistor
User
Posts: 3
Joined: Mon Dec 18, 2006 5:48 pm
Location: Mx

Can't get genre

Post by transistor » Mon Dec 18, 2006 6:15 pm

I have my mp3s tagged with iTunes 7.0.2
I can access all the information, except for the genre.
I've used:

Code: Select all

$info = $getID3->analyze($file);
$info['genre'];
$info['id3v1']['genre'];
I tried also:

Code: Select all

getid3_lib::CopyTagsToComments($info);
$info['comments_html']['genre'][0]
In most of the cases I get a blank or a different tag than the one I had in iTunes and some are correct.
In a particular case, a song has Genre: Rock (not a custom genre, as you can see), but I get blank.
What can I do?
Thank you.

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Mon Dec 18, 2006 6:17 pm

Do a

echo "<pre>";
print_r($info)

and post here if you don't find what you are looking for.

transistor
User
Posts: 3
Joined: Mon Dec 18, 2006 5:48 pm
Location: Mx

Post by transistor » Mon Dec 18, 2006 8:21 pm

Apparently it is too long to post, but it seems that the problem is in the version of ID3 tags.
If I use v1.1, I get the genre all right.

Code: Select all

[tags] => Array
        (
            [id3v1] => Array
                (
                    [title] => Array
                        (
                            [0] => Don't Ask Me
                        )

                    [artist] => Array
                        (
                            [0] => A Flock of Seagulls
                        )

                    [album] => Array
                        (
                            [0] => Flock of Seagulls
                        )

                    [year] => Array
                        (
                            [0] => 1982
                        )

                    [comment] => Array
                        (
                            [0] => http://www.allofmp3.com
                        )

                    [genre] => Array
                        (
                            [0] => Rock
                        )

                )

        )
If I use v2.4, I don't get a genre at all.

Code: Select all

[tags] => Array
        (
            [id3v2] => Array
                (
                    [title] => Array
                        (
                            [0] => Don't Ask Me
                        )

                    [artist] => Array
                        (
                            [0] => A Flock of Seagulls
                        )

                    [album] => Array
                        (
                            [0] => Flock of Seagulls
                        )

                    [part_of_a_set] => Array
                        (
                            [0] => 1/1
                        )

                    [year] => Array
                        (
                            [0] => 1982
                        )

                    [bpm] => Array
                        (
                            [0] => 165
                        )

                    [content_type] => Array
                        (
                            [0] => (17)
                        )

                    [comments] => Array
                        (
                            [0] => http://www.allofmp3.com
                        )

                )

        )
What's going on?
Could this be a bug? in iTunes or getID3?

I would prefer to user v2.4 because I can keep the lyrics and cover art (which I've wiped out doing this test, by the way) but I really need the genre.

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Mon Dec 18, 2006 8:28 pm

Bug in getID3() which has already been fixed for the upcoming 1.7.8beta and 2.0.0beta4.

The genre is present in your output:

[content_type] => Array
(
[0] => (17)
)

17 is the ID3v1 id for Rock.

transistor
User
Posts: 3
Joined: Mon Dec 18, 2006 5:48 pm
Location: Mx

Post by transistor » Mon Dec 18, 2006 10:34 pm

I see!
So, what happens with custom genres?

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Tue Dec 19, 2006 7:53 am

They should be present as strings.

Post Reply