Reputation: 543
I seem to just get sine waves no matter what.
oscillator = context.createOscillator();
oscillator.type = 1;
I notice that this example I found online works on Safari, gives me just a sine wave on chrome, and doesn't work on firefox (maybe because it uses oscillator.noteOn instead of oscillator.start?):
http://middleearmedia.com/web-audio-api-oscillators/
Upvotes: 0
Views: 422
Reputation: 13908
You need to use start(), and .type is a string type:
oscillator = context.createOscillator();
oscillator.type = "sawtooth";
oscillator.start(0);
See http://updates.html5rocks.com/2014/07/Web-Audio-Changes-in-m36.
Upvotes: 4