I am proposing re-structuring the code with async/await. Please take a look at my general direction on this approach.
context.suspend();
```suggestion
await context.suspend();
```
await new Promise((resolve, reject) => {
```suggestion
const recordingPromise = await new Promise((resolve, reject) => {
```
const expected = new Float32Array(channelData.length).fill(0);
```suggestion
const expected = new Float32Array(channelData.length);
```
context.resume().then(() => {
const playPromise = audioElement.play();
```suggestion
await context.resume();
await audioElement.play();
const recordBuffer = await recordingPromise;
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I don't have any additional comments on the current patchset. I will continue my review when Hongchan's restructuring proposal is addressed.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I am proposing re-structuring the code with async/await. Please take a look at my general direction on this approach.
thanks, I also removed `try/catch` or `.catch()` handlers that were present in the earlier code.
As it will automatically treats any unhandled promise rejections or thrown errors inside a promise_test as test failures.
context.suspend();
Saqlain```suggestion
await context.suspend();
```
Done
```suggestion
const recordingPromise = await new Promise((resolve, reject) => {
```
Done
const expected = new Float32Array(channelData.length).fill(0);
```suggestion
const expected = new Float32Array(channelData.length);
```
Done
context.resume().then(() => {
const playPromise = audioElement.play();
```suggestion
await context.resume();
await audioElement.play();
const recordBuffer = await recordingPromise;
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
// The recorded data from MESN must be non-zero. The source file
// contains 4 channels of sine wave.
It looks like this comment in the original test was copied from the "cors-check" test; it should say "zero" instead of "non-zero" for this no-cors test.
```suggestion
// The recorded data from MESN must be zero.
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
LGTM with nits
context, `recorder-processor`, {channelCount: 4});
The convention is to use single quote when you don't have anything to substitute.
if (event.data && event.data.type === `recordfinished`) {
Ditto.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |