Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Web Audio API to make sound like guitar, piano etc

I want to use Web Audio API to simulate sound like guitar or something. Currently, I am using OscillatorNode to make sound by changing frequency. But I have no idea which node should I use and how to use it to make sound like guitar or something. Should I change waveform or what? and how?

Here is some reference https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html

Thanks!

like image 245
rd6668 Avatar asked Jul 07 '14 16:07

rd6668


1 Answers

"Sound like a guitar" is a vague request. If you want to manually synthesize a guitar-esque sound using Web Audio components, you'll need to do some research into waveforms for guitars and other string instruments, then read up on techniques to create these waveforms via DSP. Here's what you're looking at: http://www.ee.columbia.edu/~ronw/dsp/

Another (probably easier) option would be to load up guitar string samples into AudioBuffer nodes and manipulate those: http://www.w3.org/TR/webaudio/#AudioBuffer

like image 109
MoskeyOmbus Avatar answered Oct 14 '22 06:10

MoskeyOmbus