Web Audio Api Convolver
How do I make an web audio api convolver?
Hacking a convolver with the web audio api.Impulse Responses by http://fokkie.home.xs4all.nl/IR.htm. What is a web audio api convolver? How do you make a web audio api convolver? This script and codes were developed by André Michelle on 18 October 2022, Tuesday.
Web Audio Api Convolver - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Web Audio Api Convolver</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h2>Web Audio Api Convolver</h2>
<div class="mix"> <div class="controls"> <label>Dry Wet</label> <input type="range" value="100" step="1" min="0" max="100" oninput="changeValue(this.value, 'mix');"></input> <label>Choose Impulse</label> <select id="impulse" size="1" onchange="loadImpulse(this.value);"> <option value="factory.hall.wav">Factory Hall</option> <option value="pa.horn.in.hall.wav">PA horn in hall</option> <option value="blaupunkt.tube.radio.wav">Blaupunkt tube radio</option> <option value="church.schellingwoude.wav">Church Schellingwoude</option> <option value="coalhod.wav">Coalhod</option> <option value="vacuum.cleaner.tube.wav">Vacuum cleaner tube</option> <option value="70.philips.box.stereo.wav">70 Philips Box</option> <option value="washing.machine.wav">Washing machine</option> <option value="tin.can.wav">Tin Can</option>
<option value="Marshall1960A-G12Ms-TAB57-CapEdgeOffAxis-6in.wav">Marshall1960A</option> </select> </div>
</div>
<h4>Impulse Responses by <a href="http://fokkie.home.xs4all.nl/IR.htm" target="_blank">Fokke van Saane</a></h4>
<h4>Music by André Michelle <a href="http://www.audiotool.com/track/mono_sonic/">mono sonic</a></h4>
<audio id="player" crossorigin controls> <source src="http://api.audiotool.com/track/mono_sonic/play.mp3" type="audio/mpeg"> <source src="http://api.audiotool.com/track/mono_sonic/play.ogg" type="audio/ogg"> Your browser does not support the audio tag.
</audio>
<p>Impulse Responses are uncompressed wav-files. Please be patient.</p>
<p>Chrome only.</p> <script src="js/index.js"></script>
</body>
</html>
Web Audio Api Convolver - Script Codes CSS Codes
html, body { font-size: 12px; font-family: "Open Sans"; background: #EEE;
}
a { text-decoration: none; color: #999;
}
audio { display: block;
}
.mix { margin: 0;
}
div.controls label { display: inline-block; text-align: right; width: 110px;
}
div.controls label, div.controls input { vertical-align: middle; padding: 0; margin: 0;
}
Web Audio Api Convolver - Script Codes JS Codes
// impulse responses by Fokke van Saane (http://fokkie.home.xs4all.nl/IR.htm)
// author: [email protected]
var context = new AudioContext();
var audioElement = document.getElementById('player');
var carrier = context.createMediaElementSource(audioElement);
var convolver = context.createConvolver();
var dry = context.createGain();
var wet = context.createGain();
carrier.connect( convolver );
convolver.connect(wet);
carrier.connect(dry);
dry.connect( context.destination );
wet.connect( context.destination );
var mix = function( value ) { dry.gain.value = ( 1.0 - value ); wet.gain.value = value;
}
var loadImpulse = function ( fileName )
{ var url = "http://files.andre-michelle.com/impulse/" + fileName; var request = new XMLHttpRequest(); request.open( "GET", url, true ); request.responseType = "arraybuffer"; request.onload = function () { context.decodeAudioData( request.response, function ( buffer ) { convolver.buffer = buffer; }, function ( e ) { console.log( e ); } ); };request.onerror = function ( e ) { console.log( e ); }; request.send();
};
loadImpulse(document.getElementById('impulse').value);
mix(1.0);
function changeValue(string,type)
{ var value = parseFloat(string) / 100.0; switch(type) { case 'mix': mix(value); break; }
}
Developer | André Michelle |
Username | andremichelle |
Uploaded | October 18, 2022 |
Rating | 3 |
Size | 3,023 Kb |
Views | 22,264 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Noise monotone increasing | 2,174 Kb |
Stern-Brocot Sequence | 2,631 Kb |
Animated text on bezier curve | 2,252 Kb |
Happy PI Day | 2,402 Kb |
X0X Clap | 2,825 Kb |
Code 7 | 2,837 Kb |
Instable Connection | 2,828 Kb |
Geolocation Api | 2,322 Kb |
Web Audio Api MultiBandCompressor | 3,553 Kb |
Web Audio Api HardLimiter | 2,697 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
The CodePen Logo | Kindofone | 4,259 Kb |
Slide out Menu | Rbiggs | 4,936 Kb |
Disable JavaScript execution from console | Ludviglindblom | 2,534 Kb |
TheCalendar.js | The-teacher | 6,330 Kb |
Incremental game | Eprouver | 5,868 Kb |
SVG Text Masking | JMChristensen | 2,141 Kb |
Retina canvas w. resize | Erikterwan | 1,882 Kb |
Multi-step GSAP animation | Acacheung | 2,668 Kb |
Sidebar Thing | Jonambas | 2,779 Kb |
Image Hover | Johnheiner | 3,409 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!