{"id":22547085,"url":"https://github.com/kiwilan/php-audio","last_synced_at":"2025-04-10T00:53:09.702Z","repository":{"id":172382347,"uuid":"649047243","full_name":"kiwilan/php-audio","owner":"kiwilan","description":"PHP package to parse and update audio files metadata, with JamesHeinrich/getID3.","archived":false,"fork":false,"pushed_at":"2025-02-03T15:09:33.000Z","size":14672,"stargazers_count":24,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T00:53:00.089Z","etag":null,"topics":["audio","audiobook","flac","id3","id3v1","id3v2","m4b","metadata","mkv","mp3","mp4","music","ogg","php","wav"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiwilan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"kiwilan"}},"created_at":"2023-06-03T15:53:06.000Z","updated_at":"2025-03-29T08:58:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"f75051e3-463f-4434-80e6-2991b036d264","html_url":"https://github.com/kiwilan/php-audio","commit_stats":null,"previous_names":["kiwilan/php-audio"],"tags_count":15,"template":false,"template_full_name":"spatie/package-skeleton-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Fphp-audio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Fphp-audio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Fphp-audio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Fphp-audio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiwilan","download_url":"https://codeload.github.com/kiwilan/php-audio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137995,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","audiobook","flac","id3","id3v1","id3v2","m4b","metadata","mkv","mp3","mp4","music","ogg","php","wav"],"created_at":"2024-12-07T15:10:04.990Z","updated_at":"2025-04-10T00:53:09.679Z","avatar_url":"https://github.com/kiwilan.png","language":"PHP","funding_links":["https://github.com/sponsors/kiwilan"],"categories":[],"sub_categories":[],"readme":"# PHP Audio\n\n![Banner with speaker and PHP Audio title](https://raw.githubusercontent.com/kiwilan/php-audio/main/docs/banner.jpg)\n\n[![php][php-version-src]][php-version-href]\n[![version][version-src]][version-href]\n[![downloads][downloads-src]][downloads-href]\n[![license][license-src]][license-href]\n[![tests][tests-src]][tests-href]\n[![codecov][codecov-src]][codecov-href]\n\nPHP package to parse and update audio files metadata, with [`JamesHeinrich/getID3`](https://github.com/JamesHeinrich/getID3).\n\n\u003e [!NOTE]\n\u003e\n\u003e You can check formats supported on [Supported formats](#supported-formats) section.\n\n## About\n\nAudio files can use different formats, this package aims to provide a simple way to read them with [`JamesHeinrich/getID3`](https://github.com/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.\n\n## Requirements\n\n-   PHP `8.1` minimum\n-   Optional for update\n    -   `FLAC`: `flac` (with `apt`, `brew` or `scoop`)\n    -   `OGG`: `vorbis-tools` (with `apt` or `brew`) / `extras/icecast` (with `scoop`)\n\n### Roadmap\n\n-   Add support for more formats with [external packages](https://askubuntu.com/questions/226773/how-to-read-mp3-tags-in-shell)\n\n## Installation\n\nYou can install the package via [composer](https://getcomposer.org/):\n\n```bash\ncomposer require kiwilan/php-audio\n```\n\n## Usage\n\nCore metadata:\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n\n$audio-\u003egetTitle(); // `?string` to get title\n$audio-\u003egetArtist(); // `?string` to get artist\n$audio-\u003egetAlbum(); // `?string` to get album\n$audio-\u003egetGenre(); // `?string` to get genre\n$audio-\u003egetYear(); // `?int` to get year\n$audio-\u003egetTrackNumber(); // `?string` to get track number\n$audio-\u003egetComment(); // `?string` to get comment\n$audio-\u003egetAlbumArtist(); // `?string` to get album artist\n$audio-\u003egetComposer(); // `?string` to get composer\n$audio-\u003egetDiscNumber(); // `?string` to get disc number\n$audio-\u003eisCompilation(); // `bool` to know if is compilation\n$audio-\u003egetCreationDate(); // `?string` to get creation date\n$audio-\u003egetCopyright(); // `?string` to get copyright\n$audio-\u003egetEncoding(); // `?string` to get encoding\n$audio-\u003egetDescription(); // `?string` to get description\n$audio-\u003egetSynopsis(); // `?string` to get synopsis\n$audio-\u003egetLanguage(); // `?string` to get language\n$audio-\u003egetLyrics(); // `?string`\n$audio-\u003egetDuration(); // `?float` to get duration in seconds\n$audio-\u003egetDurationHuman(); // `?string` to get duration in human readable format\n```\n\nRaw tags:\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n\n$raw_all = $audio-\u003egetRawAll(); // `array` with all tags\n$raw = $audio-\u003egetRaw(); // `array` with main tag\n$title = $audio-\u003egetRawKey('title'); // `?string` to get title same as `$audio-\u003egetTitle()`\n\n$format = $audio-\u003egetRaw('id3v2'); // `?array` with all tags with format `id3v2`\n$title = $audio-\u003egetRawKey('title', 'id3v2'); // `?string` to get title with format `id3v2`\n```\n\nAdditional metadata:\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n\n$audio-\u003egetPath(); // `string` to get path\n$audio-\u003egetExtension(); // `string` to get extension\n$audio-\u003ehasCover(); // `bool` to know if has cover\n$audio-\u003eisValid(); // `bool` to know if file is valid audio file\n$audio-\u003eisWritable(); // `bool` to know if file is writable\n$audio-\u003egetFormat(); // `AudioFormatEnum` to get format (mp3, m4a, ...)\n$audio-\u003egetType(); // `?AudioTypeEnum` ID3 type (id3, riff, asf, quicktime, matroska, ape, vorbiscomment)\n```\n\nYou can use `toArray()` method to get raw info:\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n\n$audio-\u003etoArray(); // `array` with all metadata\n```\n\nAdvanced properties:\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n\n$audio-\u003egetId3Reader(); // `?Id3Reader` reader based on `getID3`\n$audio-\u003egetMetadata(); // `?AudioMetadata` with audio metadata\n$audio-\u003egetCover(); // `?AudioCover` with cover metadata\n```\n\n### Update\n\nYou can update audio files metadata with `Audio::class`, but not all formats are supported. [See supported formats](#updatable-formats)\n\n\u003e [!WARNING]\n\u003e\n\u003e You can use any property of `Audio::class` but if you use a property not supported by the format, it will be ignored.\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n$audio-\u003egetTitle(); // `Title`\n\n$tag = $audio-\u003ewrite()\n  -\u003etitle('New Title')\n  -\u003eartist('New Artist')\n  -\u003ealbum('New Album')\n  -\u003egenre('New Genre')\n  -\u003eyear('2022')\n  -\u003etrackNumber('2/10')\n  -\u003ealbumArtist('New Album Artist')\n  -\u003ecomment('New Comment')\n  -\u003ecomposer('New Composer')\n  -\u003ecreationDate('2021-01-01')\n  -\u003edescription('New Description')\n  -\u003esynopsis('New Synopsis')\n  -\u003ediscNumber('2/2')\n  -\u003eencodingBy('New Encoding By')\n  -\u003eencoding('New Encoding')\n  -\u003eisCompilation()\n  -\u003elyrics('New Lyrics')\n  -\u003ecover('path/to/cover.jpg') // you can use file content `file_get_contents('path/to/cover.jpg')`\n  -\u003esave();\n\n$audio = Audio::read('path/to/audio.mp3');\n$audio-\u003egetTitle(); // `New Title`\n$audio-\u003egetCreationDate(); // `null` because `creationDate` is not supported by `MP3`\n```\n\nSome 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.\n\n#### Set tags manually\n\nYou 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).\n\n\u003e [!WARNING]\n\u003e\n\u003e 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`](https://github.com/kiwilan/php-audio/blob/main/src/Core/AudioCore.php) file.\n\u003e\n\u003e If your key is not supported, `save` method will throw an exception, unless you use `skipErrors`.\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n$audio-\u003egetAlbumArtist(); // `Band`\n\n$tag = $audio-\u003ewrite()\n    -\u003etag('composer', 'New Composer')\n    -\u003etag('genre', 'New Genre') // can be chained\n    -\u003etags([\n        'title' =\u003e 'New Title',\n        'band' =\u003e 'New Band', // `band` is used by `id3v2` to set album artist, method is `albumArtist` but `albumArtist` key will throw an exception with `id3v2`\n    ])\n    -\u003etagFormats(['id3v1', 'id3v2.4']) // optional\n    -\u003esave();\n\n$audio = Audio::read('path/to/audio.mp3');\n$audio-\u003egetAlbumArtist(); // `New Band`\n```\n\n#### Arrow functions\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n$audio-\u003egetAlbumArtist(); // `Band`\n\n$tag = $audio-\u003ewrite()\n  -\u003etitle('New Title')\n  -\u003ealbumArtist('New Band') // `albumArtist` will set `band` for `id3v2`, exception safe\n  -\u003esave();\n\n$audio = Audio::read('path/to/audio.mp3');\n$audio-\u003egetAlbumArtist(); // `New Band`\n```\n\n#### Skip errors\n\nYou can use `skipErrors` to prevent exception if you use unsupported format.\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n\n$tag = $audio-\u003ewrite()\n  -\u003etags([\n    'title' =\u003e 'New Title',\n    'title2' =\u003e 'New title', // not supported by `id3v2`, will throw an exception\n  ])\n  -\u003eskipErrors() // will prevent exception\n  -\u003esave();\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e Arrow functions are exception safe for properties but not for unsupported formats.\n\n### Raw tags\n\nAudio 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`...\n\nIf you want to extract specific field which can be skipped by `Audio::class`, you can use `raw_all` property.\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n$raw_all = $audio-\u003egetRawAll(); // all formats\n$raw = $audio-\u003egetRaw(); // main format\n```\n\n### AudioMetadata\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n$metadata = $audio-\u003egetMetadata();\n\n$metadata-\u003egetFileSize(); // `?int` in bytes\n$metadata-\u003egetSizeHuman(); // `?string` (1.2 MB, 1.2 GB, ...)\n$metadata-\u003egetExtension(); // `?string` (mp3, m4a, ...)\n$metadata-\u003egetEncoding(); // `?string` (UTF-8...)\n$metadata-\u003egetMimeType(); // `?string` (audio/mpeg, audio/mp4, ...)\n$metadata-\u003egetDurationSeconds(); // `?float` in seconds\n$metadata-\u003egetDurationReadable(); // `?string` (00:00:00)\n$metadata-\u003egetBitrate(); // `?int` in kbps\n$metadata-\u003egetBitrateMode(); // `?string` (cbr, vbr, ...)\n$metadata-\u003egetSampleRate(); // `?int` in Hz\n$metadata-\u003egetChannels(); // `?int` (1, 2, ...)\n$metadata-\u003egetChannelMode(); // `?string` (mono, stereo, ...)\n$metadata-\u003eisLossless(); // `bool` to know if is lossless\n$metadata-\u003egetCompressionRatio(); // `?float`\n$metadata-\u003egetFilesize(); // `?int` in bytes\n$metadata-\u003egetSizeHuman(); // `?string` (1.2 MB, 1.2 GB, ...)\n$metadata-\u003egetDataFormat(); // `?string` (mp3, m4a, ...)\n$metadata-\u003egetWarning(); // `?array`\n$metadata-\u003egetQuicktime(); // `?Id3AudioQuicktime\n$metadata-\u003egetCodec(); // `?string` (mp3, aac, ...)\n$metadata-\u003egetEncoderOptions(); // `?string`\n$metadata-\u003egetVersion(); // `?string`\n$metadata-\u003egetAvDataOffset(); // `?int` in bytes\n$metadata-\u003egetAvDataEnd(); // `?int` in bytes\n$metadata-\u003egetFilePath(); // `?string`\n$metadata-\u003egetFilename(); // `?string`\n$metadata-\u003egetLastAccessAt(); // `?DateTime`\n$metadata-\u003egetCreatedAt(); // `?DateTime`\n$metadata-\u003egetModifiedAt(); // `?DateTime`\n$metadata-\u003etoArray();\n```\n\n### Quicktime\n\nFor `quicktime` type, like for M4B audiobook, you can use `Id3TagQuicktime` to get more informations.\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.m4b');\n$quicktime = $audio-\u003egetMetadata()-\u003egetQuicktime();\n\n$quicktime-\u003egetHinting();\n$quicktime-\u003egetController();\n$quicktime-\u003egetFtyp();\n$quicktime-\u003egetTimestampsUnix();\n$quicktime-\u003egetTimeScale();\n$quicktime-\u003egetDisplayScale();\n$quicktime-\u003egetVideo();\n$quicktime-\u003egetAudio();\n$quicktime-\u003egetSttsFramecount();\n$quicktime-\u003egetComments();\n$quicktime-\u003egetFree();\n$quicktime-\u003egetWide();\n$quicktime-\u003egetMdat();\n$quicktime-\u003egetEncoding();\n$quicktime-\u003egetChapters(); // ?Id3AudioQuicktimeChapter[]\n```\n\n### AudioCover\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n$cover = $audio-\u003egetCover();\n\n$cover-\u003egetContents(); // `?string` raw file\n$cover-\u003egetMimeType(); // `?string` (image/jpeg, image/png, ...)\n$cover-\u003egetWidth(); // `?int` in pixels\n$cover-\u003egetHeight(); // `?int` in pixels\n```\n\n## Supported formats\n\n### Readable formats\n\n-   `id3v2` will be selected before `id3v1` or `riff` if both are available.\n\n| Format | Supported |                About                 |    ID3 type     |         Notes         |\n| :----: | :-------: | :----------------------------------: | :-------------: | :-------------------: |\n|  AAC   |    ❌     |        Advanced Audio Coding         |                 |                       |\n|  ALAC  |    ✅     |      Apple Lossless Audio Codec      |   `quicktime`   |                       |\n|  AIF   |    ✅     | Audio Interchange File Format (aif)  | `id3v2`,`riff`  |                       |\n|  AIFC  |    ✅     | Audio Interchange File Format (aifc) | `id3v2`,`riff`  |                       |\n|  AIFF  |    ✅     | Audio Interchange File Format (aiff) | `id3v2`,`riff`  |                       |\n|  DSF   |    ❌     |     Direct Stream Digital Audio      |                 |                       |\n|  FLAC  |    ✅     |      Free Lossless Audio Codec       | `vorbiscomment` |                       |\n|  MKA   |    ✅     |               Matroska               |   `matroska`    | _Cover not supported_ |\n|  MKV   |    ✅     |               Matroska               |   `matroska`    | _Cover not supported_ |\n|  APE   |    ❌     |            Monkey's Audio            |                 |                       |\n|  MP3   |    ✅     |          MPEG audio layer 3          | `id3v2`,`id3v1` |                       |\n|  MP4   |    ✅     | Digital multimedia container format  |   `quicktime`   | _Partially supported_ |\n|  M4A   |    ✅     |             mpeg-4 audio             |   `quicktime`   |                       |\n|  M4B   |    ✅     |              Audiobook               |   `quicktime`   |                       |\n|  M4V   |    ✅     |             mpeg-4 video             |   `quicktime`   |                       |\n|  MPC   |    ❌     |               Musepack               |                 |                       |\n|  OGG   |    ✅     |        Open container format         | `vorbiscomment` |                       |\n|  OPUS  |    ✅     |           IETF Opus audio            | `vorbiscomment` |                       |\n|  OFR   |    ❌     |              OptimFROG               |                 |                       |\n|  OFS   |    ❌     |              OptimFROG               |                 |                       |\n|  SPX   |    ✅     |                Speex                 | `vorbiscomment` | _Cover not supported_ |\n|  TAK   |    ❌     |        Tom's Audio Kompressor        |                 |                       |\n|  TTA   |    ✅     |              True Audio              |      `ape`      | _Cover not supported_ |\n|  WMA   |    ✅     |         Windows Media Audio          |      `asf`      | _Cover not supported_ |\n|   WV   |    ✅     |               WavPack                |      `ape`      |                       |\n|  WAV   |    ✅     |            Waveform Audio            | `id3v2`,`riff`  |                       |\n|  WEBM  |    ✅     |                 WebM                 |   `matroska`    | _Cover not supported_ |\n\nYou want to add a format? [See FAQ](#faq)\n\n### Updatable formats\n\n`JamesHeinrich/getID3` can update some formats, but not all.\n\n\u003e -   ID3v1 (v1 \u0026 v1.1)\n\u003e -   ID3v2 (v2.3, v2.4)\n\u003e -   APE (v2)\n\u003e -   Ogg Vorbis comments (need `vorbis-tools`)\n\u003e -   FLAC comments (need `flac`)\n\n| Format |         Notes         |    Requires    |\n| :----: | :-------------------: | :------------: |\n|  FLAC  | _Cover not supported_ |     `flac`     |\n|  MP3   |                       |                |\n|  OGG   | _Cover not supported_ | `vorbis-tools` |\n\n-   `flac`: with `apt`, `brew` or `scoop`\n-   `vorbis-tools`: with `apt`, `brew` or `scoop`\n    -   With `scoop`, `vorbis-tools` is not available, you can use `extras/icecast` instead.\n\n### Convert properties\n\n`Audio::class` convert some properties to be more readable.\n\n-   `ape` format: [`Id3TagApe`](https://github.com/kiwilan/php-audio/blob/main/src/Id3/Tag/Id3TagApe.php)\n-   `asf` format: [`Id3TagAsf`](https://github.com/kiwilan/php-audio/blob/main/src/Id3/Tag/Id3TagAsf.php)\n-   `id3v1` format: [`Id3TagAudioV1`](https://github.com/kiwilan/php-audio/blob/main/src/Id3/Tag/Id3TagAudioV1.php)\n-   `id3v2` format: [`Id3TagAudioV2`](https://github.com/kiwilan/php-audio/blob/main/src/Id3/Tag/Id3TagAudioV2.php)\n-   `matroska` format: [`Id3TagMatroska`](https://github.com/kiwilan/php-audio/blob/main/src/Id3/Tag/Id3TagMatroska.php)\n-   `quicktime` format: [`Id3TagQuicktime`](https://github.com/kiwilan/php-audio/blob/main/src/Id3/Tag/Id3TagQuicktime.php)\n-   `vorbiscomment` format: [`Id3TagVorbisComment`](https://github.com/kiwilan/php-audio/blob/main/src/Id3/Tag/Id3TagVorbisComment.php)\n-   `riff` format: [`Id3TagRiff`](https://github.com/kiwilan/php-audio/blob/main/src/Id3/Tag/Id3TagRiff.php)\n-   `unknown` format: [`Id3TagVorbisComment`](https://github.com/kiwilan/php-audio/blob/main/src/Id3/Tag/Id3TagVorbisComment.php)\n\n|    ID3 type     |        Original         |   New property   |\n| :-------------: | :---------------------: | :--------------: |\n|     `id3v2`     |         `band`          |  `album_artist`  |\n|     `id3v2`     |     `part_of_a_set`     |  `disc_number`   |\n|     `id3v2`     | `part_of_a_compilation` | `is_compilation` |\n|   `quicktime`   |      `compilation`      | `is_compilation` |\n|   `quicktime`   |      `encoded_by`       |  `encoding_by`   |\n|   `quicktime`   |     `encoding_tool`     |    `encoding`    |\n|   `quicktime`   |   `description_long`    |    `synopsis`    |\n|      `asf`      |      `albumartist`      |  `album_artist`  |\n|      `asf`      |       `partofset`       |  `disc_number`   |\n|      `asf`      |   `encodingsettings`    |    `encoding`    |\n| `vorbiscomment` |        `encoder`        |    `encoding`    |\n| `vorbiscomment` |      `albumartist`      |  `album_artist`  |\n| `vorbiscomment` |      `discnumber`       |  `disc_number`   |\n| `vorbiscomment` |      `compilation`      | `is_compilation` |\n| `vorbiscomment` |      `tracknumber`      |  `track_number`  |\n|   `matroska`    |         `disc`          |  `disc_number`   |\n|   `matroska`    |      `part_number`      |  `track_number`  |\n|   `matroska`    |         `date`          |      `year`      |\n|   `matroska`    |      `compilation`      | `is_compilation` |\n|   `matroska`    |        `encoder`        |    `encoding`    |\n|      `ape`      |         `disc`          |  `disc_number`   |\n|      `ape`      |      `compilation`      | `is_compilation` |\n|      `ape`      |         `track`         |  `track_number`  |\n|      `ape`      |         `date`          |      `year`      |\n|      `ape`      |        `encoder`        |    `encoding`    |\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Tools\n\n-   [ffmpeg](https://ffmpeg.org/): free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams.\n-   [MP3TAG](https://www.mp3tag.de/en/): powerful and easy-to-use tool to edit metadata of audio files (free on Windows).\n-   [Audiobook Builder](https://www.splasm.com/audiobookbuilder/): makes it easy to turn audio CDs and files into audiobooks (only macOS and paid).\n-   [Tag Editor](https://github.com/Martchus/tageditor): A tag editor with Qt GUI and command-line interface supporting MP4/M4A/AAC (iTunes), ID3, Vorbis, Opus, FLAC and Matroska.\n-   [Tag Editor](https://amvidia.com/tag-editor): a spreadsheet application for editing audio metadata in a simple, fast, and flexible way.\n\n## FAQ\n\n### I have a specific metadata field in my audio files, what can I do?\n\nIn `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.\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n$raw_all = $audio-\u003egetRawAll());\n\n$custom = null;\n$id3v2 = $raw_all['id3v2'] ?? [];\n\nif ($id3v2) {\n  $custom = $id3v2['custom'] ?? null;\n}\n```\n\nIf your field could be added to global properties of `Audio::class`, you could create an [an issue](https://github.com/kiwilan/php-audio/issues/new/choose).\n\n### Metadata are `null`, what can I do?\n\nYou can check `extras` property to know if some metadata are available.\n\n```php\nuse Kiwilan\\Audio\\Audio;\n\n$audio = Audio::read('path/to/audio.mp3');\n\n$raw_all = $audio-\u003egetRawAll();\nvar_dump($raw_all);\n```\n\nIf you find metadata which are not parsed by `Audio::class`, you can create [an issue](https://github.com/kiwilan/php-audio/issues/new/choose), otherwise `JamesHeinrich/getID3` doesn't support this metadata.z\n\n### My favorite format is not supported, what can I do?\n\nYou can create [an issue](https://github.com/kiwilan/php-audio/issues/new/choose) 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.\n\n**Please give me an example file to test the format.**\n\n### I have an issue with a supported format, what can I do?\n\nYou can create [an issue](https://github.com/kiwilan/php-audio/issues/new/choose) with informations.\n\n### How to convert audio files?\n\nThis package doesn't provide a way to convert audio files, but you can use [ffmpeg](https://ffmpeg.org/) to convert audio files and [PHP-FFMpeg/PHP-FFMpeg](https://github.com/PHP-FFMpeg/PHP-FFMpeg).\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Credits\n\n-   [`ewilan-riviere`](https://github.com/ewilan-riviere): package author\n-   [`JamesHeinrich/getID3`](https://github.com/JamesHeinrich/getID3): parser used to read audio files\n-   [`spatie/package-skeleton-php`](https://github.com/spatie/package-skeleton-php): package skeleton used to create this package\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[\u003cimg src=\"https://user-images.githubusercontent.com/48261459/201463225-0a5a084e-df15-4b11-b1d2-40fafd3555cf.svg\" height=\"120rem\" width=\"100%\" /\u003e](https://github.com/kiwilan)\n\n[version-src]: https://img.shields.io/packagist/v/kiwilan/php-audio.svg?style=flat\u0026colorA=18181B\u0026colorB=777BB4\n[version-href]: https://packagist.org/packages/kiwilan/php-audio\n[php-version-src]: https://img.shields.io/static/v1?style=flat\u0026label=PHP\u0026message=v8.1\u0026color=777BB4\u0026logo=php\u0026logoColor=ffffff\u0026labelColor=18181b\n[php-version-href]: https://www.php.net/\n[downloads-src]: https://img.shields.io/packagist/dt/kiwilan/php-audio.svg?style=flat\u0026colorA=18181B\u0026colorB=777BB4\n[downloads-href]: https://packagist.org/packages/kiwilan/php-audio\n[license-src]: https://img.shields.io/github/license/kiwilan/php-audio.svg?style=flat\u0026colorA=18181B\u0026colorB=777BB4\n[license-href]: https://github.com/kiwilan/php-audio/blob/main/README.md\n[tests-src]: https://img.shields.io/github/actions/workflow/status/kiwilan/php-audio/run-tests.yml?branch=main\u0026label=tests\u0026style=flat\u0026colorA=18181B\n[tests-href]: https://packagist.org/packages/kiwilan/php-audio\n[codecov-src]: https://img.shields.io/codecov/c/gh/kiwilan/php-audio/main?style=flat\u0026colorA=18181B\u0026colorB=777BB4\n[codecov-href]: https://codecov.io/gh/kiwilan/php-audio\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwilan%2Fphp-audio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiwilan%2Fphp-audio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwilan%2Fphp-audio/lists"}