Reputation: 357
Is there a web audio API for generating sounds with something like General MIDI synthesis? I just need simple clicks or pitches. The only web audio documentation I can find is for playback of embedded mp3/wav files, which I don't think is an ideal approach for what I want to do.
Upvotes: 3
Views: 888
Reputation: 31
In Web Audio API you have the Oscillator Node to create your own sounds as a synth.
Here you have a very good introduction:
http://blog.chrislowis.co.uk/2013/06/05/playing-notes-web-audio-api.html
Upvotes: 2
Reputation: 9423
You might find Tone.js helpful
On Github here: https://github.com/TONEnoTONE/Tone.js
also checkout this gist on javascript audio synthesis. Make sure to click the link to codepen and read the article article accompanying it.
Upvotes: 4
Reputation: 46323
There is an API for that, but it's not supported on all browsers (support table). It's called Web Audio API, here's a link to samples from MDN: Web Audio
Upvotes: 1