Web Audio API Oscillator fail to play high frequency tones
Reported by
denkenre...@gmail.com,
Jan 17
(5 days ago)
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15 Steps to reproduce the problem: 1. Get audio context 2. play frequencies above 18000 Hz and below 18000 Hz 3. notice that the oscillators above 18000 Hz sometimes stop playing and then suddenly continue playing What is the expected behavior? all the oscillators should play continuously - no matter the frequency they're playing at What went wrong? The oscillators above 18000 Hz sometimes stop playing and then suddenly continue playing (see video). As far as I can tell this only happens with frequencies above 18000 Hz. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 71.0.3578.98 (Offizieller Build) (64-Bit) Channel: stable OS Version: OS X 10.14.2 Flash Version:
,
Jan 18
(5 days ago)
,
Jan 18
(4 days ago)
denkenreden@ Thanks for the issue. Request you to provide a sample URL where this issue can be reproduced, which will help in further triaging. Thanks...
,
Jan 18
(4 days ago)
denkenreden@
The repro code doesn't seem to be working even after I fixed the code with a button:
```
document.querySelector('#btn').onclick = () => {
let ctx = new AudioContext();
let x = new SBKSessionGenerator(ctx);
x.play(511);
};
```
I don't hear anything. Can you check?
,
Jan 18
(4 days ago)
@hongchan Thank you for your help. I've build a small example illustrating the problem.
,
Jan 18
(4 days ago)
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 18
(4 days ago)
Oh, so the original repro case was working as intended. (no sound at all) Consider this line of code: ``` this.frequencies = [18500, 18800, 19100, 19400, 19700, 20000, 20300, 20600, 20900]; ``` The human audible range is typically 20hz~20Khz. But also the audibility is greatly affected by your reproduction device's frequency range (i.e. speaker, headphones and etc) This is what I use: https://www.innerfidelity.com/images/SennheiserHD650.pdf The first graph (frequency response) shows that the headphone has a significant dip (-20dB) in the 10Khz~20Khz area. That means you won't hear much of 18~20Khz from this device. Also there's one more technical constraint from our Oscillator implementation, which uses Wavetable model. Our model has the notion of "partial culling"; it basically cuts out partials beyond the Nyquist frequency, so the loudness gets smaller as the frequency approaches to the Nyquist. I think this is a common side effect of Wavetable-based oscillator. FireFox has the same implementation for the OscillatorNode, so you'll get the same effect. Do you have an actual use case that requires mathematical generation? I think it can be done with AudioWorkletNode by implementing a pure mathematical oscillator.
,
Jan 18
(4 days ago)
Especially in an academic environment (where I come from) there are quite a few people which are interested in communication using frequencies between 18 - 21 kHz. Research has shown that frequencies below 21 kHz are usually not a huge problem for speakers and microphones in typical smartphones and notebooks. I'm working on a system that allows users to join a virtual session (for example a site that provides information for a lecture) using acoustic communication. There are even MAC-Protocols for acoustic communication that target browsers. I've noticed that there are devices that are able to correctly reproduce the targeted frequencies using the code I provided and using chrome/blink. It seems as if it depends on the combination of the audio interface and the device. Even interfaces that are able to play at such high frequencies seem to fail doing so in certain situations. To be honest the more I look into this issue I realize that it might be a problem with the audio driver and NOT the browser. Especially software such as Boom 3D - even if deactivated - messes with frequencies above 18 kHz for some reason. Today I discovered that some desktop applications face the same issue. Since my goal is only to implement a prove of concept my solution is just switching to another audio driver and uninstalling all the software that might alter the audio. I appreciate your help on this and I suggest closing this issue because I assume its not chrome that modifies the audio. Thank you! -Franz
,
Jan 18
(4 days ago)
Thanks for your detailed explanation. Please share your work when it goes public! :)
,
Jan 18
(4 days ago)
Consider also using an offline audio context to examine what's happening. I like hoch.github.io/canopy to run simple examples to examine the audio output waveform. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Jan 17 (5 days ago)