[Webkit-unassigned] [Bug 224279] OfflineAudioContext startRendering fail after N calls

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 7 10:13:16 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=224279

--- Comment #5 from Jason <jasonlmcaffee at gmail.com> ---
I have further narrowed down the issue to just the instantiation of the OfflineAudioContext.  Number of instantiations until you receive the error is based on the length param.  The larger the length, the sooner you will encounter the issue.  With length 4000 * 44100, iOS 14.4.2 starts throwing errors on the 2nd instantiation.  Desktop safari (Version 14.0.3 (16610.4.3.1.7)) will show the same errors as iOS "The string did not match the expected pattern" after ~20 iterations, then crash or reload the page.

https://codepen.io/jasonmcaffee/pen/wvgrqLb

```
const AudioContext = window.AudioContext || window.webkitAudioContext;
const OfflineAudioContext = window.OfflineAudioContext || window.webkitOfflineAudioContext;

//demonstrate that iOS starts crashing or erroring when performing offline renders more than N times.
async function main(){
  const sampleRate = 44100;
  const length = 4000 * sampleRate;
  for(let i = 0; i < 60; ++i){
    print(`rendering ${i}`);
    try{
      new OfflineAudioContext(2, length, sampleRate);
    }catch(e){
      print(`error rendering offline: `, e.message);
    }
  }
  print(`done`);
}

const outputEl = document.querySelector('#output');
function print<T extends unknown>(...params: T[]){
  const message = params.map(p => JSON.stringify(p).replace(/['"]+/g, '')).join(` `);
  outputEl.innerHTML += `${message}<br/>`;
}

main();
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210407/3e2f20c5/attachment.htm>


More information about the webkit-unassigned mailing list