Skip to content
Fosowl edited this page May 30, 2020 · 4 revisions

add and set sound

note : all sound are play in a binaural way as long as they are mono and not stereo, also make sure the player entities is named "player" or it will not work, the sound are them played in the left or right ear depending on the position of the entities around the player.

add new sound

add a new sound to an entitie.

void starset_add_entities_sound(entities_t *entities, char *name , char *sound_name, char *path)

parameter

entities_t *entities : chain list of all entities on the scene.

char *name : name of the entitie to act on.

char *sound_name : name of the sound.

char *path : path to the sound in your project folder, recommend .ogg, make sure the sound file is mono and not stereo in order to make sure binaural system work.

play sound

play sound for an entitie.

void starset_entities_play_sound(entities_t *entities, char *name , char *sound_name, sfBool loop);

parameter

entities_t *entities : chain list of all entities on the scene.

char *name : name of the entitie to act on.

char *sound_name : name of the sound.

sfBool loop : set true if sound is suppose to loop when it reach the end, else set false.

set sound volume

set sound volume for one sound of an entitie.

void starset_set_sound_volume(entities_t *entities, char *name , char *sound_name, int volume);

parameter

entities_t *entities : chain list of all entities on the scene.

char *name : name of the entitie to act on.

char *sound_name : name of the sound.

int volume : volume level between 0 and 100.

Clone this wiki locally