Adding sounds to objects in the environment?

kinggori

27-02-2007 03:34:19

Hi guys

I’ve been working on this for about 7 hours continuous now and I can’t get it to work. I keep getting a runtime singleton error

I want to attach sounds to certain objects so that if I walk close to them I hear the sound and if I move far away the sound fades away

I then want to add a microphone so that I can hear sounds from objects nearby and not hear sounds from objects faraway.


Any idea how I could do this?
Is this what the listener function is for?

CaseyB

27-02-2007 03:49:01

The Listener is an object, not a function. You can attach it to a node just like you would a sound. In the demos, I have attached the Listener to the same node as the camera so that when then camera moves the Listener moves with it. This means that as your camera moves around the scene and changes its distance from the Sounds they will sound farther away.

What was the Singleton Error? What did it say?

kinggori

01-03-2007 20:29:25

this is the error i get now:

An exception has been thrown!

-----------------------------
Details
-----------------------------
Error #: 4
Function Serializer::determinedEndanness
Description: Can't find a header chunk to determine endanness
File: ..\src\OgreSerializer.cpp
Line: 79
Stack unwining <<beginning of stack>>

CaseyB

01-03-2007 22:52:38

:shock: I have no idea about that one! I've never seen it! But OgreAL doesn't use the Ogre::Serializer, so it's something you should ask over on the main forum.