Вопрос

I trying to develop a simple guitar tuner based on harmonic detection using the web audio API and js. https://github.com/lontafara/El-audio-en-la-web

I have always worked with a sample rate of 48000 Hz. Allowing me some resolution in the frequency domain. But whenever a working draft of the Web Audio API is published, this value automatically changes to 44100 for a while.

I realized for the first time in the version of 13 December, and now on April 25.

The .samplerate attribute is a readonly constant and i cant change it.

my question is, Can I continue working with a sample rate of 48000, or i've got to change to 44100? Is this change temporary, because last week the default sampling rate was still 48000?

Thank you!!!

Это было полезно?

Решение

The Web Audio API runs at whatever the default output device's sampling rate is. That is frequently 44.1kHz, but it is system-dependent. You shouldn't hardcode a sampling rate into your code.

Другие советы

Ok, as cwilso says the web audio API runs at the default device sample rate. In my case, I had to adjust the value of 44100 to get my application working properly. In Mac OS the output is set on Utilities -> Audio MIDI Setup.

There are no relation between the Web Audio API updates.

Thanks again cwilso

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top