- Notifications
You must be signed in to change notification settings - Fork3
Audio Noise Generator for Web Browsers
License
DIDAVA/dNoise
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Audio Noise Generator for Web Browsers
dNoise
is a standard audio noise generator covering most popular noise types such asWhite Noise
,Pink Noise
,Red Noise
also known asBrownian Noise
,Blue Noise
, andViolet Noise
that are used by sound engineers.dNoise
usesWeb Audio API
which is not supported in old browsers likeMicrosoft Internet Explorer
and works on latest modern browsers such asChrome
,Firefox
andSafari
.
constnoise=newdNoise();
dNoise
starts generating noise ba calling methods:
noise.white();// Starts generating white noisenoise.pink();// Starts generating pink noisenoise.blue();// Starts generating blue noisenoise.red();// Starts generating red or brownian noisenoise.violet();// Starts generating violet noise
Stops the generator immediately
noise.stop();// Stops generator
dNoise
comes with a few useful properties:
Sets or gets the output volume. The default value is1
.
noise.volume=0.75;// Sets the output volume to 0.75letcurrentVolume=noise.volume;// Gets the current output volume
Returns a list of available noise modes as an array.
letavailableModes=noise.modes;// Gets available noise modes
Returns the playback duration in seconds.
letduration=noise.time;// Gets playback duration
Returns playback duration inhh:mm:ss
format.
letduration=noise.formattedTime;// Gets formatted playback duration
For more information and details please check theexample.Improvment pulls and feature requests are welcome.