{
    "content": [
        {
            "type": "text",
            "text": "# MP3::Info (perldoc)\n\n## NAME\n\nMP3::Info - Manipulate / fetch info from MP3 audio files\n\n## SYNOPSIS\n\n#!perl -w\nuse MP3::Info;\nmy $file = 'PearlsBeforeSwine.mp3';\nsetmp3tag($file, 'Pearls Before Swine', q\"77's\",\n'Sticks and Stones', '1990',\nq\"(c) 1990 77's LTD.\", 'rock & roll');\nmy $tag = getmp3tag($file) or die \"No TAG info\";\n$tag->{GENRE} = 'rock';\nsetmp3tag($file, $tag);\nmy $info = getmp3info($file);\nprintf \"$file length is %d:%d\\n\", $info->{MM}, $info->{SS};\nmy $mp3 = new MP3::Info $file;\n$mp3->title('Perls Before Swine');\nprintf \"$file length is %s, title is %s\\n\",\n$mp3->time, $mp3->title;\n\n## DESCRIPTION\n\n$mp3 = MP3::Info->new(FILE)\nOOP interface to the rest of the module. The same keys available via getmp3info and\ngetmp3tag are available via the returned object (using upper case or lower case; but note\nthat all-caps \"VERSION\" will return the module version, not the MP3 version).\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (2 subsections)\n- **TROUBLESHOOTING**\n- **TODO**\n- **THANKS**\n- **CURRENT AUTHOR**\n- **AUTHOR EMERITUS**\n- **COPYRIGHT AND LICENSE**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "MP3::Info",
        "section": "",
        "mode": "perldoc",
        "summary": "MP3::Info - Manipulate / fetch info from MP3 audio files",
        "synopsis": "#!perl -w\nuse MP3::Info;\nmy $file = 'PearlsBeforeSwine.mp3';\nsetmp3tag($file, 'Pearls Before Swine', q\"77's\",\n'Sticks and Stones', '1990',\nq\"(c) 1990 77's LTD.\", 'rock & roll');\nmy $tag = getmp3tag($file) or die \"No TAG info\";\n$tag->{GENRE} = 'rock';\nsetmp3tag($file, $tag);\nmy $info = getmp3info($file);\nprintf \"$file length is %d:%d\\n\", $info->{MM}, $info->{SS};\nmy $mp3 = new MP3::Info $file;\n$mp3->title('Perls Before Swine');\nprintf \"$file length is %s, title is %s\\n\",\n$mp3->time, $mp3->title;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": [
                    {
                        "name": "use_mp3_utf8",
                        "lines": 13
                    },
                    {
                        "name": "use_winamp_genres",
                        "lines": 98
                    }
                ]
            },
            {
                "name": "TROUBLESHOOTING",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "TODO",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "THANKS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "CURRENT AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR EMERITUS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 25,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "MP3::Info - Manipulate / fetch info from MP3 audio files\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "#!perl -w\nuse MP3::Info;\nmy $file = 'PearlsBeforeSwine.mp3';\nsetmp3tag($file, 'Pearls Before Swine', q\"77's\",\n'Sticks and Stones', '1990',\nq\"(c) 1990 77's LTD.\", 'rock & roll');\n\nmy $tag = getmp3tag($file) or die \"No TAG info\";\n$tag->{GENRE} = 'rock';\nsetmp3tag($file, $tag);\n\nmy $info = getmp3info($file);\nprintf \"$file length is %d:%d\\n\", $info->{MM}, $info->{SS};\n\nmy $mp3 = new MP3::Info $file;\n$mp3->title('Perls Before Swine');\nprintf \"$file length is %s, title is %s\\n\",\n$mp3->time, $mp3->title;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "$mp3 = MP3::Info->new(FILE)\nOOP interface to the rest of the module. The same keys available via getmp3info and\ngetmp3tag are available via the returned object (using upper case or lower case; but note\nthat all-caps \"VERSION\" will return the module version, not the MP3 version).\n\nPassing a value to one of the methods will set the value for that tag in the MP3 file, if\napplicable.\n",
                "subsections": [
                    {
                        "name": "use_mp3_utf8",
                        "content": "Tells MP3::Info to (or not) return TAG info in UTF-8. TRUE is 1, FALSE is 0. Default is\nTRUE, if available.\n\nWill only be able to turn it on if Encode is available. ID3v2 tags will be converted to\nUTF-8 according to the encoding specified in each tag; ID3v1 tags will be assumed Latin-1\nand converted to UTF-8.\n\nFunction returns status (TRUE/FALSE). If no argument is supplied, or an unaccepted argument\nis supplied, function merely returns status.\n\nThis function is not exported by default, but may be exported with the \":utf8\" or \":all\"\nexport tag.\n"
                    },
                    {
                        "name": "use_winamp_genres",
                        "content": "Puts WinAmp genres into @mp3genres and %mp3genres (adds 68 additional genres to the\ndefault list of 80). This is a separate function because these are non-standard genres, but\nthey are included because they are widely used.\n\nYou can import the data structures with one of:\n\nuse MP3::Info qw(:genres);\nuse MP3::Info qw(:DEFAULT :genres);\nuse MP3::Info qw(:all);\n\nremovemp3tag (FILE [, VERSION, BUFFER])\nCan remove ID3v1 or ID3v2 tags. VERSION should be 1 for ID3v1 (the default), 2 for ID3v2,\nand \"ALL\" for both.\n\nFor ID3v1, removes last 128 bytes from file if those last 128 bytes begin with the text\n'TAG'. File will be 128 bytes shorter.\n\nFor ID3v2, removes ID3v2 tag. Because an ID3v2 tag is at the beginning of the file, we\nrewrite the file after removing the tag data. The buffer for rewriting the file is 4MB.\nBUFFER (in bytes) ca change the buffer size.\n\nReturns the number of bytes removed, or -1 if no tag removed, or undef if there is an error.\n\nsetmp3tag (FILE, TITLE, ARTIST, ALBUM, YEAR, COMMENT, GENRE [, TRACKNUM])\nsetmp3tag (FILE, $HASHREF)\nAdds/changes tag information in an MP3 audio file. Will clobber any existing information in\nfile.\n\nFields are TITLE, ARTIST, ALBUM, YEAR, COMMENT, GENRE. All fields have a 30-byte limit,\nexcept for YEAR, which has a four-byte limit, and GENRE, which is one byte in the file. The\nGENRE passed in the function is a case-insensitive text string representing a genre found in\n@mp3genres.\n\nWill accept either a list of values, or a hashref of the type returned by \"getmp3tag\".\n\nIf TRACKNUM is present (for ID3v1.1), then the COMMENT field can only be 28 bytes.\n\nID3v2 support may come eventually. Note that if you set a tag on a file with ID3v2, the set\ntag will be for ID3v1[.1] only, and if you call \"getmp3tag\" on the file, it will show you\nthe (unchanged) ID3v2 tags, unless you specify ID3v1.\n\ngetmp3tag (FILE [, VERSION, RAWV2, APE2])\nReturns hash reference containing tag information in MP3 file. The keys returned are the\nsame as those supplied for \"setmp3tag\", except in the case of RAWV2 being set.\n\nIf VERSION is 1, the information is taken from the ID3v1 tag (if present). If VERSION is 2,\nthe information is taken from the ID3v2 tag (if present). If VERSION is not supplied, or is\nfalse, the ID3v1 tag is read if present, and then, if present, the ID3v2 tag information\nwill override any existing ID3v1 tag info.\n\nIf RAWV2 is 1, the raw ID3v2 tag data is returned, without any manipulation of text\nencoding. The key name is the same as the frame ID (ID to name mappings are in the global\n%v2tagnames).\n\nIf RAWV2 is 2, the ID3v2 tag data is returned, manipulating for Unicode if necessary, etc.\nIt also takes multiple values for a given key (such as comments) and puts them in an\narrayref.\n\nIf APE is 1, an APE tag will be located before all other tags.\n\nIf the ID3v2 version is older than ID3v2.2.0 or newer than ID3v2.4.0, it will not be read.\n\nStrings returned will be in Latin-1, unless UTF-8 is specified (usemp3utf8), (unless\nRAWV2 is 1).\n\nAlso returns a TAGVERSION key, containing the ID3 version used for the returned data (if\nTAGVERSION argument is 0, may contain two versions).\n\ngetmp3info (FILE)\nReturns hash reference containing file information for MP3 file. This data cannot be\nchanged. Returned data:\n\nVERSION         MPEG audio version (1, 2, 2.5)\nLAYER           MPEG layer description (1, 2, 3)\nSTEREO          boolean for audio is in stereo\n\nVBR             boolean for variable bitrate\nBITRATE         bitrate in kbps (average for VBR files)\nFREQUENCY       frequency in kHz\nSIZE            bytes in audio stream\nOFFSET          bytes offset that stream begins\n\nSECS            total seconds\nMM              minutes\nSS              leftover seconds\nMS              leftover milliseconds\nTIME            time in MM:SS\n\nCOPYRIGHT       boolean for audio is copyrighted\nPADDING         boolean for MP3 frames are padded\nMODE            channel mode (0 = stereo, 1 = joint stereo,\n2 = dual channel, 3 = single channel)\nFRAMES          approximate number of frames\nFRAMELENGTH    approximate length of a frame\nVBRSCALE       VBR scale from VBR header\n\nOn error, returns nothing and sets $@.\n"
                    }
                ]
            },
            "TROUBLESHOOTING": {
                "content": "If you find a bug, please send me a patch (see the project page in \"SEE ALSO\"). If you cannot\nfigure out why it does not work for you, please put the MP3 file in a place where I can get it\n(preferably via FTP, or HTTP, or .Mac iDisk) and send me mail regarding where I can get the\nfile, with a detailed description of the problem.\n\nIf I download the file, after debugging the problem I will not keep the MP3 file if it is not\nlegal for me to have it. Just let me know if it is legal for me to keep it or not.\n",
                "subsections": []
            },
            "TODO": {
                "content": "ID3v2 Support\nStill need to do more for reading tags, such as using Compress::Zlib to decompress\ncompressed tags. But until I see this in use more, I won't bother. If something does not\nwork properly with reading, follow the instructions above for troubleshooting.\n\nID3v2 *writing* is coming soon.\n\nGet data from scalar\nInstead of passing a file spec or filehandle, pass the data itself. Would take some work,\nconverting the seeks, etc.\n\nPadding bit ?\nDo something with padding bit.\n\nTest suite\nTest suite could use a bit of an overhaul and update. Patches very welcome.\n\n*   Revamp getset.t. Test all the various getmp3tag args.\n\n*   Test Unicode.\n\n*   Test OOP API.\n\n*   Test error handling, check more for missing files, bad MP3s, etc.\n\nOther VBR\nRight now, only Xing VBR is supported.\n",
                "subsections": []
            },
            "THANKS": {
                "content": "Edward Allen, Vittorio Bertola, Michael Blakeley, Per Bolmstedt, Tony Bowden, Tom Brown, Sergio\nCamarena, Chris Dawson, Kevin Deane-Freeman, Anthony DiSante, Luke Drumm, Kyle Farrell, Jeffrey\nFriedl, brian d foy, Ben Gertzfield, Brian Goodwin, Andy Grundman, Todd Hanneken, Todd Harris,\nWoodrow Hill, Kee Hinckley, Roman Hodek, Ilya Konstantinov, Peter Kovacs, Johann Lindvall, Alex\nMarandon, Peter Marschall, michael, Trond Michelsen, Dave O'Neill, Christoph Oberauer, Jake\nPalmer, Andrew Phillips, David Reuteler, John Ruttenberg, Matthew Sachs, scfcde, Hermann\nSchwaerzler, Chris Sidi, Roland Steinbach, Brian S. Stephan, Stuart, Dan Sully, Jeffery Sumler,\nPredrag Supurovic, Bogdan Surdu, Pierre-Yves Thoulon, tim, Pass F. B. Travis, Tobias Wagener,\nRonan Waide, Andy Waite, Ken Williams, Ben Winslow, Meng Weng Wong, Justin Fletcher.\n",
                "subsections": []
            },
            "CURRENT AUTHOR": {
                "content": "Dan Sully <daniel | at | cpan.org> & Logitech.\n",
                "subsections": []
            },
            "AUTHOR EMERITUS": {
                "content": "Chris Nandor <pudge@pobox.com>, http://pudge.net/\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "Copyright (c) 2006-2008 Dan Sully & Logitech. All rights reserved.\n\nCopyright (c) 1998-2005 Chris Nandor. All rights reserved.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Logitech/Slim Devices\nhttp://www.slimdevices.com/\n\nmp3tools\nhttp://www.zevils.com/linux/mp3tools/\n\nmpgtools\nhttp://www.dv.co.yu/mpgscript/mpgtools.htm\nhttp://www.dv.co.yu/mpgscript/mpeghdr.htm\n\nmp3tool\nhttp://www.dtek.chalmers.se/~d2linjo/mp3/mp3tool.html\n\nID3v2\nhttp://www.id3.org/\n\nXing Variable Bitrate\nhttp://www.xingtech.com/support/partnerdeveloper/mp3/vbrsdk/\n\nMP3Ext\nhttp://rupert.informatik.uni-stuttgart.de/~mutschml/MP3ext/\n\nXmms\nhttp://www.xmms.org/\n",
                "subsections": []
            }
        }
    }
}