Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/owen-oj/laravel-getid3
A Laravel package to extract metadata from media files. mp3, aac, etc. It can be used with files stored on different disks such as local disk, S3 etc.
https://github.com/owen-oj/laravel-getid3
audio audio-metadata file-metadata getid3 id3 id3v1 id3v2 laravel laravel-7-package laravel-8-package laravel-getid3 laravel-package laravel8 laravel9 music
Last synced: 28 days ago
JSON representation
A Laravel package to extract metadata from media files. mp3, aac, etc. It can be used with files stored on different disks such as local disk, S3 etc.
- Host: GitHub
- URL: https://github.com/owen-oj/laravel-getid3
- Owner: Owen-oj
- License: mit
- Created: 2019-01-01T17:36:40.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-11T18:53:59.000Z (8 months ago)
- Last Synced: 2024-10-11T11:21:18.649Z (28 days ago)
- Topics: audio, audio-metadata, file-metadata, getid3, id3, id3v1, id3v2, laravel, laravel-7-package, laravel-8-package, laravel-getid3, laravel-package, laravel8, laravel9, music
- Language: PHP
- Homepage:
- Size: 173 KB
- Stars: 79
- Watchers: 3
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-getid3
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Total Downloads][ico-downloads]][link-downloads]
[![StyleCI](https://github.styleci.io/repos/163754555/shield?branch=master)](https://github.styleci.io/repos/163754555)This package is a wrapper around *james-heinrich/getid3*.
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/kkoj)
## Installation
Via Composer
``` bash
$ composer require owen-oj/laravel-getid3
```If you use Laravel 5.5+ you don't need the following step. If not, once package is installed, you need to register the service provider. Open config/app.php and add the following to the providers key.
``` bash
Owenoj\LaravelGetId3\GetId3ServiceProvider::class,
```## Usage
``` php
use Owenoj\LaravelGetId3\GetId3;//instantiate class with file
$track = new GetId3(request()->file('file'));// Use static methods:
$track = GetId3::fromUploadedFile(request()->file('file'));
$track = GetId3::fromDiskAndPath('local', '/some/file.mp3');
$track = GetId3::fromDiskAndPath('s3', '/some/file.mp3'); // even works with S3//get all info
$track->extractInfo();//get title
$track->getTitle();//get playtime
$track->getPlaytime();
```We can also extract the artwork from the file
```php
//calling this method will return artwork in base64 string
$track->getArtwork();
//Optionally you can pass can pass `true` to the method to get a jpeg version. This will return an UploadedFile instance
$track->getArtwork(true);
```## Available Methods
#### extractInfo() : array
Get an array of all available metadata of file
#### getArtist() : string
Get the artist of the track
#### getTitle() : string
Get the title of the track
#### getAlbum() : string
Get name of Album
#### getPlaytime() : string
Get a tracks total playtime
#### getPlaytimeSeconds() : float
Get total playtime in seconds
#### getArtwork()
Get the artwork of the track
#### getGenres() : array
Get the list of genres
#### getComposer() : string
Get the composers of the track
#### getTrackNumber() : string
Get the track number out of total number on album eg. 1/12
#### getCopyrightInfo() : string
Get copyright information of the track
#### getFileFormat() : string
Get the file format of the file eg. mp4## Change log
Please see the [changelog](changelog.md) for more information on what has changed recently.
## Testing
``` bash
$ composer test
```## Contributing
Please see [contributing.md](contributing.md) for details and a todolist.
## Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Owen Jubilant][link-author]
- [All Contributors][link-contributors]## License
MIT. Please see the [license file](license.md) for more information.
[ico-version]: https://img.shields.io/packagist/v/owen-oj/laravel-getid3.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/owen-oj/laravel-getid3.svg?style=flat-square
[ico-styleci]: https://styleci.io/repos/12345678/shield[link-packagist]: https://packagist.org/packages/owen-oj/laravel-getid3
[link-downloads]: https://packagist.org/packages/owen-oj/laravel-getid3
[link-styleci]: https://styleci.io/repos/12345678
[link-author]: https://github.com/owen-oj
[link-contributors]: ../../contributors]