hoch / canopy

Web Audio API programming/debugging suite
http://hoch.github.io/canopy/
MIT License
72 stars 7 forks source link

Default and/or display AudioContext sample rate #78

Open rtoy opened 7 years ago

rtoy commented 7 years ago

Many of the little demos have a default sample rate for the demo. This is fine, but if the AudioContext sample rate differs greatly from this, the playback of the saved audio buffer is resampled to the sample rate of the context. At least for Chrome, this is just a simple linear interpolation which doesn't work very well if the sample rates differ significantly.

So, as a way to alert the user, it would be nice to somehow inform him what the sample rate of the AudioContext is. And as a bonus, if the sample rate isn't specified for the snippet, perhaps it can be defaulted to the sample rate of the AudioContext.

hoch commented 7 years ago

screen shot 2017-05-01 at 10 47 23 am

This is not good enough?

rtoy commented 7 years ago

That should work for the display part.

hoch commented 7 years ago

It's already rendered/displayed based on the default value (44.1K) when the sample rate is not given.