Sound3D problem

Software: Away3D 4.x

Avatar
Baush, Sr. Member
Posted: 07 January 2012 08:08 PM   Total Posts: 135

Hello everyone, I am starting to add sounds to my project and I’m having some problems.

First off, I embed MP3 files and create Sound objects from them.


[Embed(source=“arrow.mp3”)]
private static var ArrowSound:Class;
public static var arrow:Sound = (Sound)(new ArrowSound());

Then I create a Sound3D object with a reference to my Sound object


sound = new Sound3D(AudioAsset.arrow, world.camera, null, 1, 1000);

Finally I add the Sound3D object in a container object that also includes a character mesh.


container.addChild(sound);

When calling the sound.play() method, I hear the sound fine, but the volume and pan are not affected by where the camera is (constant volume / pan)

Anyone has an idea of what I’m doing wrong?

   

Rayen123, Member
Posted: 09 January 2012 11:25 AM   Total Posts: 70   [ # 1 ]

Hi,
maybe if you are moving camera you must move sound position too

   

Avatar
Baush, Sr. Member
Posted: 09 January 2012 12:52 PM   Total Posts: 135   [ # 2 ]

Thanks Rayen,

I don’t get it, the Sound3D is added to a container that moves in the world.. Perhaps I need to add the sound directly to the root of the scene in order to work.

Has anyone got a working example using Sound3D?

Thanks!

   

Avatar
Baush, Sr. Member
Posted: 10 January 2012 10:21 PM   Total Posts: 135   [ # 3 ]

has anyone at least managed to get a sound affected by the position of the camera?

   

John Brookes, Moderator
Posted: 11 January 2012 10:28 AM   Total Posts: 732   [ # 4 ]

sound.update() in enterframe ?

Sound3D does work, although its wrong way round (louder further away).
Theres a issuse/bug of that mentioned on git.

   

Avatar
Baush, Sr. Member
Posted: 11 January 2012 12:38 PM   Total Posts: 135   [ # 5 ]

Thanks John,

That fixes the problem, but I seem to get a distance/orientation sound problem that may be the one described on Git.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X