Module OcsfmlAudio.Listener

module Listener: sig .. end
The audio listener is the point in the scene from where all the sounds are heard.

The audio listener defines the global properties of the audio environment, it defines where and how sounds and musics are heard.

If OcsfmlGraphics.view is the eyes of the user, then Listener is his ears (by the way, they are often linked together -- same position, orientation, etc.).

Listener is a simple interface, which allows to setup the listener in the 3D audio environment (position and direction), and to adjust the global volume.

Because the listener is unique in the scene, Listener is a module.

Usage example:

    (* Move the listener to the position (1, 0, -5) *)
    OcsfmlGraphics.Listener.set_position 1. 0. -5. ;
    
    (* Make it face the right axis (1, 0, 0) *)
    OcsfmlGraphics.Listener.set_direction 1. 0. 0. ;
    
    (* Reduce the global volume *)
    OcsfmlGraphics.Listener.set_global_volume 50.
    


val set_global_volume : float -> unit
Change the global volume of all the sounds and musics.

The volume is a number between 0 and 100; it is combined with the individual volume of each sound / music. The default value for the volume is 100 (maximum).

val get_global_volume : unit -> float
Get the current value of the global volume.
Returns Current global volume, in the range 0, 100
val set_position : float -> float -> float -> unit
Set the position of the listener in the scene.

The default listener's position is (0, 0, 0).

val set_position_v : float * float * float -> unit
Set the position of the listener in the scene.

The default listener's position is (0, 0, 0).

val get_position : unit -> float * float * float
Get the current position of the listener in the scene.
Returns Listener's position
val set_direction : float -> float -> float -> unit
Set the orientation of the listener in the scene.

The orientation defines the 3D axes of the listener (left, up, front) in the scene. The orientation vector doesn't have to be normalized. The default listener's orientation is (0, 0, -1).

val set_direction_v : float * float * float -> unit
Set the orientation of the listener in the scene.

The orientation defines the 3D axes of the listener (left, up, front) in the scene. The orientation vector doesn't have to be normalized. The default listener's orientation is (0, 0, -1).

val get_direction : unit -> float * float * float
Get the current orientation of the listener in the scene.
Returns Listener's orientation