Sound call backs

The sound API mirrors the betray sound API

betray_plugin_audio_unit_create

uint betray_plugin_audio_unit_create();

Description: you need to create a autio unit id in order to create callbacks

betray_plugin_callback_set_audio_sound_create

void betray_plugin_callback_set_audio_sound_create(uint audio_unit_id, uint (*func)(uint type, uint stride, uint length, uint frequency, void *data, char *name));

Description: Set a call back for betray_audio_sound_create.

betray_plugin_callback_set_audio_sound_destroy

void betray_plugin_callback_set_audio_sound_destroy(uint audio_unit_id, void (*func)(uint sound));

Description: Set a call back for betray_audio_sound_create.

betray_plugin_callback_set_audio_sound_play

void betray_plugin_callback_set_audio_sound_play(uint audio_unit_id, uint (*func)(uint sound, float *pos, float *vector, float speed, float volume, boolean loop, boolean ambient, boolean auto_delete));

Description: Set a call back for betray_audio_sound_play.

betray_plugin_callback_set_audio_sound_set

void betray_plugin_callback_set_audio_sound_set(uint audio_unit_id, void (*func)(uint play, float *pos, float *vector, float speed, float volume, boolean loop, boolean ambient));

Description: Set a call back for betray_audio_sound_set.

betray_plugin_callback_set_audio_sound_is_playing

void betray_plugin_callback_set_audio_sound_is_playing(uint audio_unit_id, boolean (*func)(uint play));

Description: Set a call back for betray_audio_sound_is_playing.

betray_plugin_callback_set_audio_sound_stop

void betray_plugin_callback_set_audio_sound_stop(uint audio_unit_id, void (*func)(uint play));

Description: Set a call back for betray_audio_sound_stop.

betray_plugin_callback_set_audio_stream_create

void betray_plugin_callback_set_audio_stream_create(uint audio_unit_id, uint (*func)(uint frequency, float *pos, float *vector, float volume, boolean ambient));

Description: Set a call back for betray_audio_stream_create.

betray_plugin_callback_set_audio_stream_destroy

void betray_plugin_callback_set_audio_stream_destroy(uint audio_unit_id, void (*func)(uint stream));

Description: Set a call back for betray_audio_stream_destroy.

betray_plugin_callback_set_audio_stream_feed

void betray_plugin_callback_set_audio_stream_feed(uint audio_unit_id, void (*func)(uint stream, uint type, uint stride, uint length, void *data));

Description: Set a call back for betray_audio_stream_feed.

betray_plugin_callback_set_audio_stream_buffer_left

void betray_plugin_callback_set_audio_stream_buffer_left(uint audio_unit_id, uint (*func)(uint stream));

Description: Set a call back for betray_audio_stream_buffre_left.

betray_plugin_callback_set_audio_stream_set

void betray_plugin_callback_set_audio_stream_set(uint audio_unit_id, void (*func)(uint stream, float *pos, float *vector, float volume, boolean ambient));

Description: Set a call back for betray_audio_stream_set.

betray_plugin_callback_set_audio_listener

void betray_plugin_callback_set_audio_listener(uint audio_unit_id, void (*func)(float *pos, float *vector, float *forward, float *side, float scale, float speed_of_sound))

Description: Set a call back for betray_audio_listener.

betray_plugin_callback_set_audio_read

void betray_plugin_callback_set_audio_read(uint audio_unit_id, uint (*func)(void *data, uint type, uint buffer_size), uint channels, float *vectors);

Description: Set up a Audio recording unit, by defining the number of channels it can record, its verctors (array of 3 * channels floats) and the callback to be called by the application to get access to the recorded data.

betray_plugin_audio_master_volume_get

float betray_plugin_audio_master_volume_get(void);

Description: Returns the volume level set by the application from Zero to One