NAME
Audio::Audiere::Stream::3D - a 3D sound (stream) in Audio::Audiere
SYNOPSIS
See Audio::Audiere for usage.
EXPORTS
Exports nothing.
DESCRIPTION
This package provides you with individual sound streams. It should not be used on it's own, but via Audio::Audiere.
Volume/Pan/Pitch calculation
The volume of a 3D sound source is influenced by the following factors:
- distance
-
The farther away a sound source is, the less loud it will appear.
- dampening factor
-
A local dampening factor applied to each sound source can simulate sound comming from behind windows, doors, columns etc.
- master volume
-
The master volume might further reduce the volume.
- volume
-
The volume of the sound source itself.
The pan of a 3D sound source is mainly influenced by the position of the sound source in relation to the listener.
The pitch is only modified for sound sources that move in relation to the listener, thus simulating the Doppler effect.
METHODS
Almost all of the methods from Audio::Audiere::Stream can also be used on a 3D stream, with a few exceptions and additions:
Not supported methods
The following methods are not suppored because they don't make sense on 3D sounds:
Additional methods
The following additional methods are also available:
- setDampeningFactor
-
$stream_3D->setDampeningFactor(1);
Sets a global dampening factor (1 => 0%, no dampening, 0 => 100%, completely dampened). You can use this to modify the volume of a 3D sound source temporarily without having to store and modify their general volume.
For instance, a sound source that is not in line of sight of the listener could be dampened by 20%, another one behind a window by 60% and so on.
Set whether the stream is visible from the listener or not. The idea behind this is that sound sources not directly visible get damped by a certain factor. For instance, a sound source behind a stone column would be not as loud as one directly visible.
- getDampeningFactor
-
if ($stream_3D->getVisible()) { ... }
Returns the dampening factor for this stream. See setDampeningFactor.
- setOrigin
-
$stream_3d->setOrigin( $x, $y, $z );
Sets the center point of the 3D sound source, e.g. where the sound will appear to come from.
- getOrigin
-
($x,$y,$z) = $stream_3d->getOrigin();
Returns the center point of the 3D sound source, e.g. where the sound will appear to come from.
BUGS
The 3D sound support is not yet fully working.
AUTHORS
(c) 2004 Tels <http://bloodgate.com/>