Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static and streaming sound playback tests #16477

Merged

Conversation

docEdub
Copy link
Contributor

@docEdub docEdub commented Apr 11, 2025

Adds static and streaming sound playwright playback tests, including a shared test module for tests common to both types of sounds, and some helpful utility code.

Note that some of the changes in this PR are trivial and should be viewed with whitespace changes hidden.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

packages/tools/tests/test/audioV2/common/abstractSound.common.ts:14

  • The variable 'audioTestConfig' is referenced without any visible import or definition in this file. Ensure it is imported or defined in the current scope.
const sound = await AudioV2Test.CreateAbstractSoundAsync(soundType, audioTestConfig.pulsed3CountSoundFile);

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@docEdub docEdub requested a review from Copilot April 11, 2025 08:08
@docEdub docEdub changed the title Add common static and streaming sound tests Add static and streaming sound playback tests Apr 11, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

They are typically values transitioning across the zero line when the polarity changes, and are not representative of the actual pulse volume.

Ignoring them reduces flaky test results.
@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@docEdub docEdub marked this pull request as ready for review April 11, 2025 09:19
@docEdub docEdub enabled auto-merge (squash) April 11, 2025 09:19
@docEdub docEdub requested a review from Copilot April 11, 2025 09:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

packages/tools/tests/test/audioV2/utils/audioV2.utils.ts:221

  • The exclusion of the first and last samples in the average volume calculation uses hard-coded offsets. Please add a clarifying comment or refactor to define these exclusion boundaries with named constants for clarity.
for (let j = pulseStartIndex + 1; j < pulseEndIndex - 1; j++) {

packages/tools/babylonServer/public/audiov2-test.js:116

  • The state constant has been changed from BABYLON.SoundState.STOPPED to BABYLON.SoundState.Stopped; please verify that this matches the Babylon API convention to avoid potential state-check issues.
if (sound.state !== BABYLON.SoundState.Stopped) {

packages/tools/tests/test/audioV2/shared/abstractSound.playback.ts:120

  • [nitpick] The TODO comment indicates a pending refactor for test organization; consider relocating or resolving this TODO to improve code clarity and maintainability.
// TODO: Move this somewhere else. It doesn't make sense to have it here.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

Audio test results:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/16477/merge/testResults/audioV2/index.html

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 11, 2025

@docEdub docEdub merged commit 7c50d5c into BabylonJS:master Apr 11, 2025
17 checks passed
@docEdub docEdub deleted the 250410-add-common-playwright-sound-tests branch April 11, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants