find a sound emitter's location relative to the user

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

find a sound emitter's location relative to the user

Brad Fuller-4
Is there documentation, or can someone explain to me how the audio
works in Croquet?

In the documentation that comes with the SDK, there are two places
where sound is mentioned:

----
ambientSound - current local sound - to be deprecated.

A programmer uses the Croquet libraries to render the object
individually, and the system will take care of rendering it in
relationship to all
the other objects. It can have sound and the system will take care of combining
the sound of all the objects with respect to their relative positions
to the user.
----

I understand that OpenAL is used. How does the system take care of
sound emitters that the user's position to the sound emitters? Is
there a way that I can obtain the x,y,z position of a sound emitter
relative to the user's position?


--
Brad Fuller
Reply | Threaded
Open this post in threaded view
|

Re: find a sound emitter's location relative to the user

Brad Fuller-4
On Wed, Oct 29, 2008 at 6:25 PM, Brad Fuller <[hidden email]> wrote:
> I understand that OpenAL is used. How does the system take care of
> sound emitters that the user's position to the sound emitters? Is
> there a way that I can obtain the x,y,z position of a sound emitter
> relative to the user's position?

Perhaps I'm not clear, since I have a typo in the first sentence, and
that's why there were no answers.
Or, maybe it's a question that has been answered many times and I just
can't find it in the archives.
 Let me try again.

How can I find the location (in x,y,z) of an object relative to the
user's position?

--
Brad Fuller
Reply | Threaded
Open this post in threaded view
|

Re: Re: find a sound emitter's location relative to the user

Andreas.Raab
Brad Fuller wrote:

> On Wed, Oct 29, 2008 at 6:25 PM, Brad Fuller <[hidden email]> wrote:
>> I understand that OpenAL is used. How does the system take care of
>> sound emitters that the user's position to the sound emitters? Is
>> there a way that I can obtain the x,y,z position of a sound emitter
>> relative to the user's position?
>
> Perhaps I'm not clear, since I have a typo in the first sentence, and
> that's why there were no answers.
> Or, maybe it's a question that has been answered many times and I just
> can't find it in the archives.
>  Let me try again.
>
> How can I find the location (in x,y,z) of an object relative to the
> user's position?

I think your question hasn't been answered since OpenAL does this
transformation for you. All you do is provide the transforms for the
listener and the sound sources.

You can of course, compute the relative position yourself; it's merely
transforming the position of the sound source into the local frame of
the listener which can be achieved simply by:

   listener globalToLocal: speaker globalPosition.

or (somewhat more efficiently) via:

   listener globalTransform orthoNormInverse transformPoint: speaker
globalPosition.

Cheers,
   - Andreas
Reply | Threaded
Open this post in threaded view
|

Re: Re: find a sound emitter's location relative to the user

Brad Fuller-4
On Fri, Oct 31, 2008 at 11:22 AM, Andreas Raab <[hidden email]> wrote:

> Brad Fuller wrote:
>>
>> On Wed, Oct 29, 2008 at 6:25 PM, Brad Fuller <[hidden email]>
>> wrote:
>>>
>>> I understand that OpenAL is used. How does the system take care of
>>> sound emitters that the user's position to the sound emitters? Is
>>> there a way that I can obtain the x,y,z position of a sound emitter
>>> relative to the user's position?
>>
>> Perhaps I'm not clear, since I have a typo in the first sentence, and
>> that's why there were no answers.
>> Or, maybe it's a question that has been answered many times and I just
>> can't find it in the archives.
>>  Let me try again.
>>
>> How can I find the location (in x,y,z) of an object relative to the
>> user's position?
>
> I think your question hasn't been answered since OpenAL does this
> transformation for you. All you do is provide the transforms for the
> listener and the sound sources.
>
> You can of course, compute the relative position yourself; it's merely
> transforming the position of the sound source into the local frame of the
> listener which can be achieved simply by:
>
>  listener globalToLocal: speaker globalPosition.
>
> or (somewhat more efficiently) via:
>
>  listener globalTransform orthoNormInverse transformPoint: speaker
> globalPosition.

Thanks, I'll look there. I understand that OpenAL does this, but I
wanted to do it myself using another audio system. I guess that wasn't
clear.

Thanks!

brad


--
Brad Fuller