Skip to main content

Sound spatilization capabilities in Wonderland 0.5?

6 replies [Last post]
itranaya
Offline
Joined: 2006-10-02
Points: 0

I am working on a project which has (to be) specialized sounds. I believe in 0.4 there was such capabilities using may be VoiceHandler. Is there a similar way of doing it using 0.5? or is there any other way of doing it?

I saw in a another post Music In 0.5? which is discussed about adding audio capabilities to a cell. But what I need is to control audio my self. Any of your help is highly appreciated.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jprovino
Offline
Joined: 2007-03-29
Points: 0

Hi Itranaya, can you tell me more about what you want to do?

In .5, latest trunk, you can add audio capabilities to any cell.
Right click on a cell in-world, and select properties.
At the bottom left, click the + button.
Then add Audio Capabilities.
Then click on the Audio Capabilities component.
In the right panel you can specify audio parameters.

After that, when you right click on the cell, there will be more audio options
such as play, stop, pause, resume, volume.

If this doesn't provide the functionality you need, take a look at

modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioTreatmentComponentMO.java.

The .5 code base provides a voicemanager interface.
Take a look in
https://jvoicebridge.dev.java.net/source/browse/jvoicebridge/branches/jp...

VoiceManager.java
Call*.java
Treatment*.java

itranaya
Offline
Joined: 2006-10-02
Points: 0

Hi jprovino,

Thank you very much for your quick reply. I will do what you have suggested and keep the forum updated.

Basically I need to know, if we place a sound source can the avatar feel the specialization, if the sound source moves
around the avatar can the avatar locate where it comes from. First I need to place sound source
at a particular place and then I need to move around the avatar, which I have no idea of how to do it.

That's my plan and I do really appreciate you can help me.

jprovino
Offline
Joined: 2007-03-29
Points: 0

Hi Itranaya, what you want to do should work. For a quick test, try inserting the singing teapot.
You can move any cell which has a movable component by right clicking on the cell,
and selecting edit. You will get affordances which allow you to move the cell.

Here is some documentation which will help with what you want to do:

This section shows you how to use the UI:

Add Sound to the Radio

http://wiki.java.net/bin/view/Javadesktop/ProjectWonderlandArtworkForNon...

And this section provides details on the property sheet:

Using the Audio Capabilities Property Sheet

http://wiki.java.net/bin/view/Javadesktop/ProjectWonderlandArtworkForNon...

itranaya
Offline
Joined: 2006-10-02
Points: 0

Hi jprovino, I could do what I wanted to do, thank you very much for your hint, which was exactly what I needed. My spatialization method was like follows: I think it might be valuable to somebody else.

[pre]
protected void spatialize() {
VoiceManager vm = AppContext.getManager(VoiceManager.class);
if (falloff >= 1) {
TheCellMO.falloff = .999;
}
TreatmentGroup group = vm.createTreatmentGroup(groupId);
logger.info("ID: " + groupId + " cellRadius "
+ TheCellMO.CELL_RADIUS + " extent " + extent + " fvr "
+ fullVolumeRadius + " falloff " + falloff + " volume "
+ volume);
// audio treatment setup
TreatmentSetup setup = new TreatmentSetup();
DefaultSpatializer spatializer = new DefaultSpatializer();
setup.spatializer = spatializer;
spatializer.setFullVolumeRadius(fullVolumeRadius);
spatializer.setZeroVolumeRadius(extent);
FalloffFunction falloffFunction = spatializer.getFalloffFunction();
falloffFunction.setFalloff(falloff);
setup.spatializer.setAttenuator(volume
* DefaultSpatializer.DEFAULT_MAXIMUM_VOLUME);
// set the file/url as the treatment
setup.treatment = this.getTreatment(

); Vector3f location = this.getLocationInTheSpace(); setup.x = location.getX(); setup.y = location.getY(); setup.z = location.getZ(); logger.info("Starting treatment " + setup.treatment + " at (" + setup.x + ":" + setup.y + ":" + setup.z + ")"); try { Treatment t = vm.createTreatment(treatmentId, setup); group.addTreatment(t); } catch (IOException e) { logger.info("Unable to create treatment " + setup.treatment + e.getMessage()); return; } } [/pre] Message was edited by: itranaya
jprovino
Offline
Joined: 2007-03-29
Points: 0

Thanks for the code. You'll find something similar in

/modules/tools/audio-manager/src/classes/org/jdesktop/wonderland/modules/audiomanager/server/AudioTreatmentComponentMO.java

joe

itranaya
Offline
Joined: 2006-10-02
Points: 0

Hi Joe,

Thanks for the previous help, I extended my project implementing music browser. I have almost done it, but I need to improve it by adding a capability to listen only a single source. When there are several sources near by, it's kind of disturbance to the listener, so such function would be impressive. Any idea about how I can do this implementation?

Thank you,
Rasika