Download the PHP package kiwilan/php-audio without Composer

On this page you can find all versions of the php package kiwilan/php-audio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-audio

PHP Audio

Banner with speaker and PHP Audio title

php version downloads license tests codecov

PHP package to parse and update audio files metadata, with JamesHeinrich/getID3.

[!NOTE]

You can check formats supported on Supported formats section.

About

Audio files can use different formats, this package aims to provide a simple way to read them with JamesHeinrich/getID3. The JamesHeinrich/getID3 package is excellent to read metadata from audio files, but output is just an array, current package aims to provide a simple way to read audio files with a beautiful API.

Requirements

Roadmap

Installation

You can install the package via composer:

Usage

Core metadata:

Raw tags:

Additional metadata:

You can use toArray() method to get raw info:

Advanced properties:

Update

You can update audio files metadata with Audio::class, but not all formats are supported. See supported formats

[!WARNING]

You can use any property of Audio::class but if you use a property not supported by the format, it will be ignored.

Some properties are not supported by all formats, for example MP3 can't handle some properties like lyrics or stik, if you try to update these properties, they will be ignored.

Set tags manually

You can set tags manually with tag() or tags() methods, but you need to know the format of the tag, you could use tagFormats to set formats of tags (if you don't know the format, it will be automatically detected).

[!WARNING]

If you use tags method, you have to use key used by metadata container. For example, if you want to set album artist in id3v2, you have to use band key. If you want to know which key to use check src/Core/AudioCore.php file.

If your key is not supported, save method will throw an exception, unless you use skipErrors.

Arrow functions

Skip errors

You can use skipErrors to prevent exception if you use unsupported format.

[!NOTE]

Arrow functions are exception safe for properties but not for unsupported formats.

Raw tags

Audio files format metadata with different methods, JamesHeinrich/getID3 offer to check these metadatas by different methods. In raw_all property of Audio::class, you will find raw metadata from JamesHeinrich/getID3 package, like id3v2, id3v1, riff, asf, quicktime, matroska, ape, vorbiscomment...

If you want to extract specific field which can be skipped by Audio::class, you can use raw_all property.

AudioMetadata

Quicktime

For quicktime type, like for M4B audiobook, you can use Id3TagQuicktime to get more informations.

AudioCover

Supported formats

Readable formats

Format Supported About ID3 type Notes
AAC Advanced Audio Coding
ALAC Apple Lossless Audio Codec quicktime
AIF Audio Interchange File Format (aif) id3v2,riff
AIFC Audio Interchange File Format (aifc) id3v2,riff
AIFF Audio Interchange File Format (aiff) id3v2,riff
DSF Direct Stream Digital Audio
FLAC Free Lossless Audio Codec vorbiscomment
MKA Matroska matroska Cover not supported
MKV Matroska matroska Cover not supported
APE Monkey's Audio
MP3 MPEG audio layer 3 id3v2,id3v1
MP4 Digital multimedia container format quicktime Partially supported
M4A mpeg-4 audio quicktime
M4B Audiobook quicktime
M4V mpeg-4 video quicktime
MPC Musepack
OGG Open container format vorbiscomment
OPUS IETF Opus audio vorbiscomment
OFR OptimFROG
OFS OptimFROG
SPX Speex vorbiscomment Cover not supported
TAK Tom's Audio Kompressor
TTA True Audio ape Cover not supported
WMA Windows Media Audio asf Cover not supported
WV WavPack ape
WAV Waveform Audio id3v2,riff
WEBM WebM matroska Cover not supported

You want to add a format? See FAQ

Updatable formats

JamesHeinrich/getID3 can update some formats, but not all.

  • ID3v1 (v1 & v1.1)
  • ID3v2 (v2.3, v2.4)
  • APE (v2)
  • Ogg Vorbis comments (need vorbis-tools)
  • FLAC comments (need flac)
Format Notes Requires
FLAC Cover not supported flac
MP3
OGG Cover not supported vorbis-tools

Convert properties

Audio::class convert some properties to be more readable.

ID3 type Original New property
id3v2 band album_artist
id3v2 part_of_a_set disc_number
id3v2 part_of_a_compilation is_compilation
quicktime compilation is_compilation
quicktime encoded_by encoding_by
quicktime encoding_tool encoding
quicktime description_long synopsis
asf albumartist album_artist
asf partofset disc_number
asf encodingsettings encoding
vorbiscomment encoder encoding
vorbiscomment albumartist album_artist
vorbiscomment discnumber disc_number
vorbiscomment compilation is_compilation
vorbiscomment tracknumber track_number
matroska disc disc_number
matroska part_number track_number
matroska date year
matroska compilation is_compilation
matroska encoder encoding
ape disc disc_number
ape compilation is_compilation
ape track track_number
ape date year
ape encoder encoding

Testing

Tools

FAQ

I have a specific metadata field in my audio files, what can I do?

In Audio::class, you have a property raw_all which contains all raw metadata, if JamesHeinrich/getID3 support this field, you will find it in this property.

If your field could be added to global properties of Audio::class, you could create an an issue.

Metadata are null, what can I do?

You can check extras property to know if some metadata are available.

If you find metadata which are not parsed by Audio::class, you can create an issue, otherwise JamesHeinrich/getID3 doesn't support this metadata.z

My favorite format is not supported, what can I do?

You can create an issue with the format name and a link to the format documentation. If JamesHeinrich/getID3 support this format, I will add it to this package but if you want to contribute, you can create a pull request with the format implementation.

Please give me an example file to test the format.

I have an issue with a supported format, what can I do?

You can create an issue with informations.

How to convert audio files?

This package doesn't provide a way to convert audio files, but you can use ffmpeg to convert audio files and PHP-FFMpeg/PHP-FFMpeg.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of php-audio with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
james-heinrich/getid3 Version ^v1.9.22
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kiwilan/php-audio contains the following files

Loading the files please wait ....