PHPackages                             synchro/laravel-medialibrary-audio - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. synchro/laravel-medialibrary-audio

ActiveLibrary[Image &amp; Media](/categories/media)

synchro/laravel-medialibrary-audio
==================================

Audio file thumbnail generator for Spatie's Laravel Media Library

v3.1.0(10mo ago)303.9k↑60%2[2 issues](https://github.com/Synchro/laravel-medialibrary-audio/issues)MITPHPPHP ^8.1CI passing

Since Nov 4Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/Synchro/laravel-medialibrary-audio)[ Packagist](https://packagist.org/packages/synchro/laravel-medialibrary-audio)[ Docs](https://github.com/spatie/laravel-medialibrary)[ GitHub Sponsors](https://github.com/Synchro)[ Patreon](https://www.patreon.com/marcusbointon)[ RSS](/packages/synchro-laravel-medialibrary-audio/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (9)Dependencies (11)Versions (12)Used By (0)

Audio File Thumbnail Generator for Spatie's Laravel Media Library
=================================================================

[](#audio-file-thumbnail-generator-for-spaties-laravel-media-library)

This audio image generator generates thumbnails for audio files uploaded through [Spatie's Media Library](https://github.com/spatie/laravel-medialibrary), just as it already does for image, video, and PDF formats. By default they look like this:

[![Example waveform image](https://github.com/Synchro/laravel-medialibrary-audio/raw/main/tests/testfiles/example_waveform.png)](https://github.com/Synchro/laravel-medialibrary-audio/blob/main/tests/testfiles/example_waveform.png)

Spatie's docs have more details of [how plugins integrate with Media Library](https://spatie.be/docs/laravel-medialibrary/v9/converting-other-file-types/creating-a-custom-image-generator). Thumbnails of a mono waveform of the whole audio file are generated using ffmpeg's `waveform` converter. It uses the same [PHP FFMpeg package](https://packagist.org/packages/php-ffmpeg/php-ffmpeg) that is used for the video formats already supported by Media Library, so there are no additional dependencies.

Installation &amp; configuration
--------------------------------

[](#installation--configuration)

Install using composer with:

```
composer require synchro/laravel-medialibrary-audio

```

Installing Spatie's Media Library (version 9.1.0 or later) in your Laravel project will generate a config file in `config/media-library.php`. Add the audio waveform generator to the list of generators in the `image_generators` section, including optionally setting default `width`, `height`, `foreground` and `background` properties (default values shown):

```
'image_generators' => [
    ...,
    Synchro\MediaLibrary\Conversions\ImageGenerators\AudioWaveform::class => [
        'width' => 2048,
        'height' => 2048,
        'foreground' => '#113554',
        'background' => '#CBE2F4', // or '' for transparent background
    ]
],
```

These parameters are optional - you can leave them out if you're happy with the defaults.

Thumbnail colours
-----------------

[](#thumbnail-colours)

The waveform is drawn in the foreground colour, over the background colour. Both should be specified using standard HTML 6-digit hex values (with a leading `#`) passed through the media library config, as above. You may also pass an empty string for background to generate a transparent background; make sure you use -&gt;format('png') when registering media conversions on the model.

Thumbnail sizing
----------------

[](#thumbnail-sizing)

The base size of the thumbnails can be set via the media library config, as shown above. The default is 2048 x 2048 pixels, neutral values chosen because audio files have no inherent size or aspect ratio. This is quite large, but since the images are very simple, they will compress very well in PNG format. This size doesn't directly affect the thumbnails delivered to clients because media library itself generates scaled-down versions to match client requests, however, it does have a direct effect on the aspect ratio of the thumbnails, so if you want a 16:9 ratio, change the height to `1152`, or `1536` for 4:3.

Supported formats
-----------------

[](#supported-formats)

- `aiff`
- `flac`
- `m4a`
- `mp3`
- `mp4`
- `ogg`
- `wav`
- `wma`

Running tests
-------------

[](#running-tests)

If your local ffmpeg installation is in a different path you can use the environment variables to define your own path:

```
FFMPEG_PATH=/usr/local/bin/ffmpeg FFPROBE_PATH=/usr/local/bin/ffprobe vendor/bin/phpunit
```

Or on recent macOS with homebrew:

```
FFMPEG_PATH=/opt/homebrew/bin/ffmpeg FFPROBE_PATH=/opt/homebrew/bin/ffprobe vendor/bin/phpunit
```

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance67

Regular maintenance activity

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 77.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~193 days

Recently: every ~247 days

Total

10

Last Release

327d ago

Major Versions

v0.1.3 → 8.0.x-dev2022-11-28

v0.2 → v1.0.02023-01-12

v1.0.0 → v2.0.02024-04-09

v2.0.0 → v3.0.02025-05-21

PHP version history (4 changes)v0.1.0PHP ^7.4|^8.0

8.0.x-devPHP ^7.4 || ^8.0

v1.0.0PHP ^8.0

v3.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e7028bcadbec2ee934da04d4d6232600481ac137b30b724ef116dfd55dbe9a9?d=identicon)[Synchro](/maintainers/Synchro)

---

Top Contributors

[![Synchro](https://avatars.githubusercontent.com/u/81561?v=4)](https://github.com/Synchro "Synchro (44 commits)")[![Gummibeer](https://avatars.githubusercontent.com/u/6187884?v=4)](https://github.com/Gummibeer "Gummibeer (8 commits)")[![normanyung](https://avatars.githubusercontent.com/u/772789?v=4)](https://github.com/normanyung "normanyung (3 commits)")[![madurapa](https://avatars.githubusercontent.com/u/4289578?v=4)](https://github.com/madurapa "madurapa (2 commits)")

---

Tags

laravelconversionaudiomedialaravel-medialibrary

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/synchro-laravel-medialibrary-audio/health.svg)

```
[![Health](https://phpackages.com/badges/synchro-laravel-medialibrary-audio/health.svg)](https://phpackages.com/packages/synchro-laravel-medialibrary-audio)
```

###  Alternatives

[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M633](/packages/spatie-laravel-medialibrary)[okipa/laravel-medialibrary-ext

Extra features for spatie/laravel-medialibrary package.

1011.2k](/packages/okipa-laravel-medialibrary-ext)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
