PHPackages                             ghostzero/wav - 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. ghostzero/wav

ActiveLibrary

ghostzero/wav
=============

Simple PHP library for creating and handling WAV audio files

03PHP

Since Jul 17Pushed 4y agoCompare

[ Source](https://github.com/ghostzero/wav)[ Packagist](https://packagist.org/packages/ghostzero/wav)[ RSS](/packages/ghostzero-wav/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

WAV
===

[](#wav)

Simple PHP Library for working with wav-files

Installation
============

[](#installation)

Installation using composer composer require nkolosov/wav

\#Usage Simple usage:

```
    ...
    $file = Parser::fromFile('/path/to/file.wav');
    echo $file->getSampleRate(); //44100
    ...
```

You can create music file from code:

```
    ...
    $sampleBuilder = new Piano(); //create piano sound generator

    //generate first notes of Für Elise (Ludwig van Beethoven)
    $samples = [
            $sampleBuilder->note('E', 5, 0.3),
            $sampleBuilder->note('D#', 5, 0.3),
            $sampleBuilder->note('E', 5, 0.3),
            $sampleBuilder->note('D#', 5, 0.3),
            $sampleBuilder->note('E', 5, 0.3),
            $sampleBuilder->note('H', 4, 0.3),
            $sampleBuilder->note('D', 5, 0.3),
            $sampleBuilder->note('C', 5, 0.3),
            $sampleBuilder->note('A', 4, 1),
    ];

    $builder = (new Builder())
         ->setAudioFormat(\Wav\WaveFormat::PCM)
         ->setNumberOfChannels(1)
         ->setSampleRate(\Wav\Builder::DEFAULT_SAMPLE_RATE)
         ->setByteRate(\Wav\Builder::DEFAULT_SAMPLE_RATE * 1 * 16 / 8)
         ->setBlockAlign(1 * 16 / 8)
         ->setBitsPerSample(16)
         ->setSamples($samples);

    $audio = $builder->build();
    $audio->returnContent(); //return wav-file content directly to browser/console
    ...
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 77.8% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/03da561a330aa76d1a09096b2ee0c48ee53ca51d62fa0239469d9615b6855733?d=identicon)[ghostzero](/maintainers/ghostzero)

---

Top Contributors

[![nkolosov](https://avatars.githubusercontent.com/u/4259497?v=4)](https://github.com/nkolosov "nkolosov (7 commits)")[![ghostzero](https://avatars.githubusercontent.com/u/6547306?v=4)](https://github.com/ghostzero "ghostzero (2 commits)")

### Embed Badge

![Health badge](/badges/ghostzero-wav/health.svg)

```
[![Health](https://phpackages.com/badges/ghostzero-wav/health.svg)](https://phpackages.com/packages/ghostzero-wav)
```

PHPackages © 2026

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