Aw noise

From ActiveWiki
Jump to navigation Jump to search


Minimum requirements
Added in version 4.1
SDKbuild 53


int aw_noise (int session_id)

Description

Sends a noise.

Callback

None (returns immediately)

Notes

This method will trigger AW_EVENT_NOISE in a neighbor, or all neighbors (i.e. if session_id is 0), provided that they are subscribing to the event.

Only world server administration instances or those owned by a caretaker (i.e. aw_bool (AW_WORLD_CARETAKER_CAPABILITY) returns 1) may use this method.

Arguments

session_id
Session number of recipient. If set to 0 then all neighbors are recipients.

Argument attributes

AW_SOUND_NAME
This is either an absolute URL (e.g. "http://objects.activeworlds.com/aw/sounds/sbtechno4.mp3") or the name of a file in the sound folder of an object path (e.g. "noise.mp3").

Return values

RC_SUCCESS
RC_NOT_INITIALIZED
RC_NO_INSTANCE
RC_NO_CONNECTION
The connection to the world is down.

Returned attributes

None

Usage

Play tickle.mp3 to any user who clicks another avatar.

void handle_avatar_click (void)
{
  aw_string_set (AW_SOUND_NAME, "tickle.mp3");
  aw_noise (aw_int (AW_AVATAR_SESSION));
}

Subscribing to the event should be done before entering the world.

aw_event_set (AW_EVENT_AVATAR_CLICK, handle_avatar_click);

See also