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

Dev audio #7485 #7562

Merged
merged 5 commits into from
Nov 12, 2015
Merged

Dev audio #7485 #7562

merged 5 commits into from
Nov 12, 2015

Conversation

vincent-courtalon
Copy link
Contributor

current state of audio Evolution.
Still need to add some fonction and the setSource capability

…olume

 Changes to be committed:
	modified:   examples/misc_sound.html
	new file:   examples/sounds/Project_Utopia.ogg
	modified:   examples/sounds/readme.txt
	modified:   src/audio/Audio.js
	new file:   src/audio/AudioBuffer.js
	modified:   src/audio/AudioListener.js
	new file:   src/audio/PositionAudio.js
	modified:   utils/build/includes/common.json

THREE.AudioListener.prototype.setFilter = function ( value ) {

if (this.filter !== null && this.filter !== undefined) {
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think we need to check for undefined here.

@vincent-courtalon
Copy link
Contributor Author

Yes, we can add back a load method for compatibility. let me add this
i will also change/simplify the test:

if (this.filter !== null && this.filter !== undefined)

…ffer now only take the Audio context instead of the listener at creation
@vincent-courtalon
Copy link
Contributor Author

I also changed AudioBuffer to not need the listener at construction, only the webaudio context. Needed that to add back simple load function in Audio.

@mrdoob
Copy link
Owner

mrdoob commented Nov 12, 2015

Looks good!

mrdoob added a commit that referenced this pull request Nov 12, 2015
@mrdoob mrdoob merged commit 8ad7a3e into mrdoob:dev Nov 12, 2015
@mrdoob
Copy link
Owner

mrdoob commented Nov 12, 2015

Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Nov 12, 2015

Played a bit more with it. Pretty exciting stuff!

@vincent-courtalon
Copy link
Contributor Author

thank you for the feedBack!

I agree. The webAudio API has a lot of pretty cool stuff. Apart from the AudioBuffer for loading, all the filter and node stuff open a lot of possibility (there are some really cool demo online of some of the possibilities). Really, the oscillatorNode i added as example is a poor attempt at showing the real possibilities.
We can later imagine, for example, to hook up any audioStream to a PositionalAudio, like some network audio stream or the sound of a video/microphone with some added effect, or whatever.

as an aside, i already spotted one possible/necessary enhancement. If you need to create as you go PositionalAudio (for a game for example), you should probably be able to "clean up" PositionalAudio/Audio once they are not anymore useful (for example out of range, object emitting destroyed, etc..). Sure you can "reuse/recycle" them, but maybe a little function to disconnect it from the listener, and more generally cleaning any remaining Node reference would be useful.

I am still testing it to see if it really would be useful.

@vincent-courtalon vincent-courtalon deleted the dev_audio_#7485 branch November 13, 2015 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants