All notable changes to php-audio
will be documented in this file.
Add toArray()
to quicktime
for AudioMetadata
BREAKING CHANGES
- internal architecture has been totally redesigned
get()
static method is nowread()
(old method is still available)update()
method is nowwrite()
(old method is still available)getAudio()
is nowgetMetadata()
getStat()
has been removed, you can findgetLastAccessAt()
,getCreatedAt()
,getModifiedAt()
intogetMetadata()
getWriter()
has been removed, only used whenwrite()
method is calledgetReader()
is nowgetId3Reader()
getPodcastDescription()
is nowgetSynopsis()
getStik()
has been removed (you can find it ingetRaw()
method or withgetRawKey('stik')
)- cover contents is now base64 encoded into
AudioCover
object toArray()
has been revised to return a more structured arraygetDuration()
is nowfloat
- add
getDurationHuman()
to get human readable duration - add
getTrackNumberInt()
to get track number as integer - add
getDiscNumberInt()
getTags()
is nowgetRawAll()
as multidimensional array- new method
getRaw()
will return main format as array - new method
getRawKey('ANY_KEY')
will return specific key from main format getAudioFormats()
has been removedgetExtras()
has been removed (duplicate ofgetRawAll()
,getRaw()
ortoArray()
)writer()
can now usetag('ANY_KEY', 'ANY_VALUE')
to update directly any tag without usetags()
writer()
methodtags()
has been modified, it's not native method ofgetID3
anymore, just an array of tags- add
getQuicktime()
toAudioMetadata
to get quicktime tags, with chapters for audiobooks
AudioCover
- now contents are stored as base64 encoded string
- new
getContents()
method to get contents, default is raw string (binary) and you can get base64 encoded string withtrue
parameter - new
getMimeType()
method to get mime type of the cover - new
getWidth()
method to get width of the cover - new
getHeight()
method to get height of the cover - new
toArray()
method to get cover as array
AudioMetadata
getFilesize()
is nowgetFileSize()
- add
getSizeHuman()
to get human readable size with decimal precision - add
getDataFormat()
to get data format likemp3
- remove
getDurationReadable()
because it's now intoAudio::class
getLossless()
is nowisLossless()
- add
getCodec()
to get codec of the file, likeLAME
- add
getEncoderOptions()
to get encoder options of the file, likeCBR
- add
getVersion()
to get version ofJamesHeinrich/getID3
- add
getAvDataOffset()
to get offset of audio/video data - add
getAvDataEnd()
to get end of audio/video data - add
getFilePath()
to get file path, like/path/to
- add
getFilename()
to get filename, likefile.mp3
- add
getLastAccessAt()
,getCreatedAt()
,getModifiedAt()
fromstat()
function - add
toArray()
method to get metadata as array
Fix
- now
write()
won't erase other tags #34
Add getDurationHumanReadable()
method to get the duration in human readable format: HH:MM:SS
.
By @panVag
- use
DateTimeImmutable
super powers to parse date and datetime strings - catch and ignore exception when instantiating the aforementioned object so the whole script won't fail
- remove the null safe operators when it's not needed
- Add
getAudioFormats()
toAudio::class
to get an array with all audio formats of file. - Add param to
getTags(?string $audioFormat = null)
to select a specific tag format, default will be maximum tags found. - Add same param to
getTag(string $tag, ?string $audioFormat = null)
to select a specific tag format, default will be maximum tags found. - Add
getPodcastDescription()
method toAudio::class
to get the podcast description. - Add
getLanguage()
method toAudio::class
to get the language of the podcast.
- Add
toArray()
method toAudio::class
to get all properties without cover. - Add
getTags()
method toAudio::class
to get all tags asarray<string, string>
. - Add
getTag(string $tag)
method toAudio::class
to get a single tag.
AudioCore
, fixfromId3()
withnull
checkId3AudioTagV1
andId3AudioTagV2
, issue #18 thanks to @cospin
AudioCore
,fromId3()
method comment bug, issue #18 thanks to @cospinAudioMetadata
, addpath
,dataformat
- Id3Writer:
trackNumber()
anddiscNumber()
accept now integers (and strings)
- Add
getContents()
to AudioCover - Old method
getContent()
is deprecated
- All simple getters have now
get
prefix. For example,getTitle()
instead oftitle()
,getAlbum()
instead ofalbum()
, etc. It concerns all simple getters ofAudioCore
,AudioCover
,AudioMetadata
,AudioStat
,Id3Reader
classes.
Why? All these classes have some methods like setters or actions. To be consistent and clear, all simple getters have now
get
prefix.
BREAKING CHANGES
update
chained methods are now withoutset
prefix
Features
update
have nowtags
to set tags manuallyupdate
have nowtagFormats
to set tag formats manuallyupdate
have nowpreventFailOnError
to prevent fail on error
- fix ci
- fix Windows bugs
Official version
For Audio::class
- to parse audio file
make
static method is nowget
- add
update
method toAudio::class
to update metadata id3
property is nowreader
andwriter
- new enums
AudioTypeEnum
andAudioFormatEnum
- Add more formats
- add multiple formats
- add some properties
- refactoring
init