Set position

From Bennu Wiki
Jump to navigation Jump to search


Definition

INT set_position ( <INT channel> , <INT angle> , <INT distance> )

Sets the position of a sound channel. With this function you can "emulate" a simple 3d audio effect. If you only want to control the distance, you can use Set_distance().


Parameters

INT channel - The sound channel to change the position of.
INT angle - The angle (0-360).
INT distance - The distance (0-255).

Returns

INT : Status.

0 - Ok.
-1 - Error: sound inactive.

Notes

Angle value's

0 degrees - Sound is directly in front.
90 degrees - Sound is directly to the right.
180 degrees - Sound is directly behind.
270 degrees - Sound is directly to the left.


Distance value's

0 - The sound is near (or at it's loudest).
255 - The sound is far away (very quite).



Sound Functions
Fade_music_in()Fade_music_off()Is_playing_song()Is_playing_wav()Load_song()Load_wav()Pause_song()Pause_wav()Play_song()Play_wav()Reserve_channels()Resume_song()Resume_wav()Reverse_stereo()Set_channel_volume()Set_distance()Set_music_position()Set_panning()Set_position()Set_song_volume()Set_Wav_Volume()Sound_close()Sound_init()Stop_song()Stop_wav()Unload_song()Unload_wav()