Skip to content

Add audio engine v2 #15839

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

Merged
merged 268 commits into from
Mar 4, 2025
Merged

Add audio engine v2 #15839

merged 268 commits into from
Mar 4, 2025

Conversation

docEdub
Copy link
Contributor

@docEdub docEdub commented Nov 18, 2024

This change adds the initial audio engine v2 implementation and introduces the API for sound and streaming sound creation and playback, in addition to audio buses (formerly known as SoundTracks).

@ryantrem
Copy link
Member

Am I remembering correctly from previous conversations that the new audio engine will implement the existing interfaces, or no?

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 18, 2024

@docEdub
Copy link
Contributor Author

docEdub commented Nov 18, 2024

Am I remembering correctly from previous conversations that the new audio engine will implement the existing interfaces, or no?

Yes, this is something we discussed as a possibility.

It is not needed. The sound plays without adding it to the document body.
This is particularly important for Vision Pro because it suspends/interrupts the audio context when exiting immersive mode.
The WebAudio-based streaming sound class's underlying `HTMLMediaElement` play and stop functions don't have `waitTime` parameters like the static sound class's `AudioBufferSourceNode` does. I tried implementing them in the streaming sound class using `setTimeout`, but the timing is too flaky, so this change removes the parameter completely.

Note that the `waitTime` parameter for the static sound classes remains, but it is moved to the end of the parameter list so the streaming and static sound class play signatures are consistent with each other.
@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@docEdub docEdub marked this pull request as ready for review March 4, 2025 07:13
@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat

This comment was marked as duplicate.

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 4, 2025

Copy link
Member

@RaananW RaananW left a comment

Choose a reason for hiding this comment

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

🎉

@docEdub docEdub merged commit 7df8a57 into BabylonJS:master Mar 4, 2025
15 checks passed
@docEdub docEdub added the audio label Mar 6, 2025
@docEdub docEdub deleted the audio-engine-v2 branch April 7, 2025 21:00
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.

5 participants