getID3() by James Heinrich (<info@getid3.org>)
===
**Available at <http://getid3.sourceforge.net> or <https://www.getid3.org>**
getID3() is released under multiple licenses. You may choose from the following licenses, and use getID3 according to the terms of the license most suitable to your project.
**GNU GPL:**
* [v3](https://gnu.org/licenses/gpl.html)
* [v2](https://gnu.org/licenses/old-licenses/gpl-2.0.html)
* [v1](https://gnu.org/licenses/old-licenses/gpl-1.0.html)
**GNU LGPL:**
* [v3](https://gnu.org/licenses/lgpl.html)
**Mozilla MPL:**
* [v2](https://www.mozilla.org/MPL/2.0/)
**getID3 Commercial License:**
* [gCL](https://www.getid3.org/#gCL) (payment required)
* * *
Copies of each of the above licenses are included in the `licenses/`
directory of the getID3 distribution.
If you want to donate, there is a link on <https://www.getid3.org> for PayPal donations.
Quick Start
===
**Q:** How can I check that getID3() works on my server/files?
**A:** Unzip getID3() to a directory, then access `/demos/demo.browse.php`
Support
===
**Q:** I have a question, or I found a bug. What do I do?
**A:** The preferred method of support requests and/or bug reports is the forum at <http://support.getid3.org/>
Sourceforge Notification
===
It's highly recommended that you sign up for notification from
Sourceforge for when new versions are released. Please visit:
<http://sourceforge.net/project/showfiles.php?group_id=55859>
and click the little "monitor package" icon/link. If you're
previously signed up for the mailing list, be aware that it has
been discontinued, only the automated Sourceforge notification
will be used from now on.
What does getID3() do?
===
Reads & parses (to varying degrees):
+ tags:
* APE (v1 and v2)
* ID3v1 (& ID3v1.1)
* ID3v2 (v2.4, v2.3, v2.2)
* Lyrics3 (v1 & v2)
+ audio-lossy:
* MP3/MP2/MP1
* MPC / Musepack
* Ogg (Vorbis, OggFLAC, Speex, Opus)
* AAC / MP4
* AC3
* DTS
* RealAudio
* Speex
* DSS
* VQF
+ audio-lossless:
* AIFF
* AU
* Bonk
* CD-audio (*.cda)
* FLAC
* LA (Lossless Audio)
* LiteWave
* LPAC
* MIDI
* Monkey's Audio
* OptimFROG
* RKAU
* Shorten
* TTA
* VOC
* WAV (RIFF)
* WavPack
+ audio-video:
* ASF: ASF, Windows Media Audio (WMA), Windows Media Video (WMV)
* AVI (RIFF)
* Flash
* Matroska (MKV)
* MPEG-1 / MPEG-2
* NSV (Nullsoft Streaming Video)
* Quicktime (including MP4)
* RealVideo
+ still image:
* BMP
* GIF
* JPEG
* PNG
* TIFF
* SWF (Flash)
* PhotoCD
+ data:
* ISO-9660 CD-ROM image (directory structure)
* SZIP (limited support)
* ZIP (directory structure)
* TAR
* CUE
+ Writes:
* ID3v1 (& ID3v1.1)
* ID3v2 (v2.3 & v2.4)
* VorbisComment on OggVorbis
* VorbisComment on FLAC (not OggFLAC)
* APE v2
* Lyrics3 (delete only)
Requirements
===
* PHP 4.2.0 up to 5.2.x for getID3() 1.7.x (and earlier)
* PHP 5.0.5 (or higher) for getID3() 1.8.x (and up)
* PHP 5.0.5 (or higher) for getID3() 2.0.x (and up)
* at least 4MB memory for PHP. 8MB or more is highly recommended.
12MB is required with all modules loaded.
Usage
===
See /demos/demo.basic.php for a very basic use of getID3() with no
fancy output, just scanning one file.
See structure.txt for the returned data structure.
**For an example of a complete directory-browsing, file-scanning implementation of getID3(), please run /demos/demo.browse.php**
See /demos/demo.mysql.php for a sample recursive scanning code that
scans every file in a given directory, and all sub-directories, stores
the results in a database and allows various analysis / maintenance
operations
To analyze remote files over HTTP or FTP you need to copy the file
locally first before running getID3(). Your code would look something
like this:
``` php
<?php
// Copy remote file locally to scan with getID3()
$remotefilename = 'http://www.example.com/filename.mp3';
if ($fp_remote = fopen($remotefilename, 'rb')) {
$localtempfilename = tempnam('/tmp', 'getID3');
if ($fp_local = fopen($localtempfilename, 'wb')) {
while ($buffer = fread($fp_remote, 8192)) {
fwrite($fp_local, $buffer);
}
fclose($fp_local);
// Initialize getID3 engine
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($localtempfilename);
// Delete temporary file
unlink($localtempfilename);
}
fclose($fp_remote);
}
```
**See /demos/demo.write.php for how to write tags.**
What does the returned data structure look like?
===
See structure.txt
It is recommended that you look at the output of
/demos/demo.browse.php scanning the file(s) you're interested in to
confirm what data is actually returned for any particular filetype in
general, and your files in particular, as the actual data returned
may vary considerably depending on what information is available in
the file itself.
Notes
===
getID3() 1.x:
---
If the format parser encounters a critical problem, it will return
something in `$fileinfo['error']`, describing the encountered error. If
a less critical error or notice is generated it will appear in
`$fileinfo['warning']`. Both keys may contain more than one warning or
error. If something is returned in ['error'] then the file was not
correctly parsed and returned data may or may not be correct and/or
complete. If something is returned in `['warning']` (and not `['error']`)
then the data that is returned is OK - usually getID3() is reporting
errors in the file that have been worked around due to known bugs in
other programs. Some warnings may indicate that the data that is
returned is OK but that some data could not be extracted due to
errors in the file.
getID3() 2.x:
---
See above except errors are thrown (so you will only get one error).
Disclaimer
===
getID3() has been tested on many systems, on many types of files,
under many operating systems, and is generally believe to be stable
and safe. That being said, there is still the chance there is an
undiscovered and/or unfixed bug that may potentially corrupt your
file, especially within the writing functions. By using getID3() you
agree that it's not my fault if any of your files are corrupted.
In fact, I'm not liable for anything :)
License
===
GNU General Public License - see license.txt
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
FAQ:
---
**Q:** Can I use getID3() in my program? Do I need a commercial license?
**A:** You're generally free to use getID3 however you see fit. The only
case in which you would require a commercial license is if you're
selling your closed-source program that integrates getID3. If you
sell your program including a copy of getID3, that's fine as long
as you include a copy of the sourcecode when you sell it. Or you
can distribute your code without getID3 and say "download it from
getid3.sourceforge.net"
Why is it called "getID3()" if it does so much more than just that?
===
v0.1 did in fact just do that. I don't have a copy of code that old, but I
could essentially write it today with a one-line function:
``` php
function getID3($filename) { return unpack('a3TAG/a30title/a30artist/a30album/a4year/a28comment/c1track/c1genreid', substr(file_get_contents($filename), -128)); }
```
Future Plans
===
<https://www.getid3.org/phpBB3/viewforum.php?f=7>
* Better support for MP4
破碎的天堂鸟
- 粉丝: 9977
- 资源: 2943
最新资源
- 三菱FX3U 步进电机算FB块 FB块的使用可以使程序模块化简单化,进而提高了程序的稳定性和可移植性 此例中使用FB块,可以实现步进电机的算,已知距离求得脉冲数,已知速度可以求得频率 程序中包含
- 双向隔离DCDC仿真simulink
- 基于PSO粒子群PID控制器参数整定粒子群PID psopid 基于粒子群算法整定PID控制器,实现PID控制器参数的自整定(PSO-PID) matlab编写,源码注释详细具体如图,评价指标详
- 3567954014871001-进程的概念.zip
- 伺服电机、步进电机通用的S曲线及梯形加减速控制源码,十分经典,有中文注释及实现原理说明 系前期从某高手卖家处高价购得(技术源头实为国外专业公司) 本人已经在多个自动化控制系统中采用,为摊低成本故低
- DSP28335的Svpwm处理器在环仿真(matlab simulink)
- cruise模型,增程汽车仿真模型,恒功率控制 关于模型: 1.模型是个base模型,基于cruise simulink联合仿真,主要实现恒功率控制以及电制动优先的能量回收策略,主要供学习使用
- Polarion表结构
- ssm中小型企业财务管理系统+jsp.zip
- ssm珠宝首饰交易平台开发+jsp.zip
- ssm助学贷款+jsp.zip
- ssm职工健康每日申报系统设计+vue.zip
- ssm在线作业管理系统的设计与实现+vue.zip
- ssm中国咖啡文化宣传网站的设计与实现+vue.zip
- FIFO verilogIP 包括深度为1的fifo 包括普通同步FIFO和异步FIFO,均为first word fall through模式,同步fifo三种写法,异步fifo三种写法,可参
- ssm在线医疗服务系统+jsp.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈