-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Add THREE.AudioLoader #8370
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 THREE.AudioLoader #8370
Conversation
Hi Reece! Can you also adjust the following sound showcase in the three.js example directory? Some of the code would be deprecated after your changes. Example: var sound1 = new THREE.PositionalAudio( listener );
sound1.load( 'sounds/358232_j_s_song.ogg' ); Besides, it's maybe a good idea to place the deprecated code into |
Do you think there is a way to use |
@Mugen87 Thanks for your suggestions :) I will update the example now and add |
@Mugen87 My latest commits should tackle your suggestions |
Looks good! After studying at your changes, i realize that the code in @mrdoob What do you think about @EvilPeanut's implementation? Using |
@EvilPeanut One more thing 😉. Can you add |
@Mugen87 Added it :) |
|
||
}; | ||
|
||
THREE.Audio.prototype.play = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you removed the space in function () {
in a bunch of places. Do you mind reverting that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change that now. Sorry for these little mistakes. It is my first time contributing :).
I have tried to follow the contribution guidelines though and used http://zz85.github.io/mrdoobapproves/ which is why I removed the spaces, is it an issue with the site?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an issue with the site indeed.
@zz85 do you mind addressing this?
Sounds good to me 😊 |
Looks good! |
Thanks! |
FYI I've added |
I have added
THREE.AudioLoader
to asynchronously load anAudioBuffer
and provide callbacks foronLoad
,onProgress
andonError
. Related issues: #8176, #8367.The
THREE.AudioLoader
depreciatesTHREE.AudioBuffer
andTHREE.Audio
's.load
, I have added depreciation messages to the old functions.I have also made a documentation page for
THREE.AudioLoader
which is included.Here is an example how
THREE.AudioLoader
can be used to load and play a sound once loaded