PHP code example of gemorroj / file-wav

1. Go to this page and download the library: Download gemorroj/file-wav library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gemorroj / file-wav example snippets



use FileWav\Wav;

$wav = new Wav('path_to/file.wav');


print_r($wav->getInfo());
/*
FileWav\Info Object
(
    [filesize:FileWav\Info:private] => 1073218
    [filename:FileWav\Info:private] => path_to/file.wav
    [compression:FileWav\Info:private] => 1
    [channels:FileWav\Info:private] => 2
    [framerate:FileWav\Info:private] => 8000
    [byterate:FileWav\Info:private] => 32000
    [bits:FileWav\Info:private] => 16
    [length:FileWav\Info:private] => 33.529625
)
 */