Giter Site home page Giter Site logo

owen-oj / laravel-getid3 Goto Github PK

View Code? Open in Web Editor NEW
76.0 3.0 12.0 177 KB

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.

License: MIT License

PHP 100.00%
laravel getid3 audio music file-metadata audio-metadata laravel-getid3 id3v2 id3 id3v1

laravel-getid3's People

Contributors

bumbummen99 avatar dependabot[bot] avatar laravel-shift avatar mrtawil avatar nvahalik avatar owen-oj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-getid3's Issues

Changing ID3 to MP3

Hello.
Is it possible to change the received data and save it to mp3 using PHP?

Undefined array key "comments"

This package works fine on Laravel 9, except for this:

Seeding: Database\Seeders\SongSeeder

   ErrorException 

  Undefined array key "comments"

  at vendor/owen-oj/laravel-getid3/src/GetId3.php:101
     97▕      * @throws \getid3_exception
     98▕      */
     99▕     private function comments()
    100▕     {
  ➜ 101▕         return $this->extractInfo()['comments'];
    102▕     }
    103▕ 
    104▕     /**
    105▕      * Get the title of the media file.

      +2 vendor frames 
  3   database/seeders/SongSeeder.php:31
      Owenoj\LaravelGetId3\GetId3::getArtist()

      +8 vendor frames 
  12  database/seeders/DatabaseSeeder.php:17
      Illuminate\Database\Seeder::call()

This is my seeder:

        $files = Storage::disk('musicas')->allFiles();
        sort($files);

        foreach ($files as $file) {
            if (!Song::find($file)) {

                $filename = basename($file, ".mp3");
                $filepath = Storage::disk('musicas')->path($file);
                $track = new GetId3($filepath);
                $artist = $track->getArtist();
                $title = $track->getTitle();
                $playtime = $track->getPlaytime();

                Song::create([
                    'artist' => $artist,
                    'title' => $title,
                    'playtime' => $playtime,
                    'filename' => $filename,
                    'filesize' => Storage::disk('musicas')->size($file),
                    'filepath' => $filepath,
                    'last_modified' => Storage::disk('musicas')->lastModified($file),
                ]);
            }
        }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.