Skip to content

Generate sinusoidal sound wave as wav or mp3 from a list of frequencies and durations

License

Notifications You must be signed in to change notification settings

dvictor/php-wave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

php-wave

Generate sinusoidal sound wave as wav or mp3 from a list of frequencies and durations

I created this class because on some phones (Safari iOS) the tones generated with JavaScript had the wrong frequency.

You need to have lame installed:

apt-get install lame

Usage:

$song = array(1000, 1500, 1200);
$duration = .3;

$wav = new Wave(44100);
for ($i=0; $i<count($song); $i++)
    $wav->addTone($song[$i], $duration);
header('X-Debug-info: '.join(',', $song));
$wav->outMp3();

About

Generate sinusoidal sound wave as wav or mp3 from a list of frequencies and durations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages