MonoGameAudio Type
The MonoGame-only 3D audio surface, extending IAudio
the way the backend's IAssets extends IAssetCache. Registered
alongside IAudio by the MonoGame hosts; resolve it with
GameContext.getService<MonoGameAudio> ctx. The raylib backend
has no listener model, so 3D positioning is not part of the portable
contract — the Core Attenuation2D helper covers the portable case.
Instance members
| Instance member |
Description
|
Full Usage:
this.DistanceScale
Returns: float32
Modifiers: abstract |
Scales world units to the distances at which 3D sounds attenuate. Wraps
|
Full Usage:
this.DopplerScale
Returns: float32
Modifiers: abstract |
Scales the Doppler effect strength for 3D sounds (0 = off). Wraps
|
Full Usage:
this.Play3D
Parameters:
string
-
The game-vocabulary key the sound was registered under.
emitterPosition : Vector3
-
Emitter position in world units.
?emitterVelocity : Vector3
-
Emitter velocity in world units per second (drives Doppler shift). Defaults to zero.
?voice : Voice
-
Volume and pitch knobs; Volume scales the distance-attenuated result. Defaults to Voice.center.
Modifiers: abstract |
Plays a registered sound positioned at an emitter in 3D: distance attenuation, panning, and Doppler shift come from the listener/emitter geometry. Pan from the voice is ignored — geometry decides it.
|
Full Usage:
this.SetListener
Parameters:
Vector3
-
Listener position in world units.
forward : Vector3
-
Listener facing direction (unit length).
up : Vector3
-
Listener up direction (unit length).
velocity : Vector3
-
Listener velocity in world units per second (drives Doppler shift).
Modifiers: abstract |
Sets where the listener hears from: the camera is the usual choice. Call again as it moves; playing 3D sounds re-attenuate on the next tick. |
Mibo