Conforms to NSObject
Declared in ALSoundSource.h

Overview

Manages all properties relating to an OpenAL sound source. There are currently two classes that adhere to this protocol: ALSource and ChannelSource (which collectively manipulates a set of ALSource objects). A full description of the properties themselves is available in the OpenAL 1.1 Specification and Reference: http://connect.creativelabs.com/openal/Documentation

Tasks

  •   coneInnerAngle

    Cone inner angle (OpenAL property).

    property required method
  •   coneOuterAngle

    Cone outer angle (OpenAL property).

    property required method
  •   coneOuterGain

    Cone outer gain (OpenAL property).

    property required method
  •   direction

    Direction (OpenAL property).

    property required method
  •   gain

    Gain (volume) (OpenAL property).

    property required method
  •   volume

    Volume (alias to gain).

    property required method
  •   interruptible

    If true, this source may be interrupted when resources are low.

    property required method
  •   looping

    Looping (OpenAL property).

    property required method
  •   maxDistance

    Max distance (OpenAL property).

    property required method
  •   maxGain

    Max gain (OpenAL property).

    property required method
  •   minGain

    Min gain (OpenAL property).

    property required method
  •   muted

    If true, this source is muted.

    property required method
  •   paused

    If true, this source is currently paused.

    property required method
  •   pitch

    Pitch (OpenAL property).

    property required method
  •   playing

    If true, this source is currently playing audio.

    property required method
  •   position

    Position (OpenAL property).

    property required method
  •   referenceDistance

    Reference distance (OpenAL property).

    property required method
  •   rolloffFactor

    Rolloff factor (OpenAL property).

    property required method
  •   sourceRelative

    Source relative (OpenAL property).

    property required method
  •   sourceType

    Source type (OpenAL property).

    property required method
  •   velocity

    Velocity (OpenAL property).

    property required method
  •   pan

    Pan value (-1.0 = far left, 1.0 = far right). Note: This effect is simulated by changing the source’s X position. Do not use this property if you are modifying the position property as well.

    property required method
  • – play:

    Play a sound.

    required method
  • – play:loop:

    Play a sound, optionally looping.

    required method
  • – play:gain:pitch:pan:loop:

    Play a sound, setting gain, pitch, pan, and looping.

    required method
  • – stop

    Stop playing the current sound.

    required method
  • – rewind

    Stop playing the current sound and set its state to AL_INITIAL.

    required method
  • – fadeTo:duration:target:selector:

    Fade to the specified gain value.

    required method
  • – stopFade

    Stop the currently running fade operation, if any.

    required method
  • – panTo:duration:target:selector:

    pan to the specified value.

    required method
  • – stopPan

    Stop the currently running pan operation, if any.

    required method
  • – pitchTo:duration:target:selector:

    Gradually change pitch to the specified value.

    required method
  • – stopPitch

    Stop the currently running pitch operation, if any.

    required method
  • – stopActions

    Stop any currently running fade, pan, or pitch operations.

    required method
  • – clear

    Clear any buffers this source is currently using.

    required method

Properties

coneInnerAngle

Cone inner angle (OpenAL property).

@property (readwrite, assign) float coneInnerAngle

Declared In

ALSoundSource.h

coneOuterAngle

Cone outer angle (OpenAL property).

@property (readwrite, assign) float coneOuterAngle

Declared In

ALSoundSource.h

coneOuterGain

Cone outer gain (OpenAL property).

@property (readwrite, assign) float coneOuterGain

Declared In

ALSoundSource.h

direction

Direction (OpenAL property).

@property (readwrite, assign) ALVector direction

Declared In

ALSoundSource.h

gain

Gain (volume) (OpenAL property).

@property (readwrite, assign) float gain

Declared In

ALSoundSource.h

interruptible

If true, this source may be interrupted when resources are low.

@property (readwrite, assign) bool interruptible

Declared In

ALSoundSource.h

looping

Looping (OpenAL property).

@property (readwrite, assign) bool looping

Declared In

ALSoundSource.h

maxDistance

Max distance (OpenAL property).

@property (readwrite, assign) float maxDistance

Declared In

ALSoundSource.h

maxGain

Max gain (OpenAL property).

@property (readwrite, assign) float maxGain

Declared In

ALSoundSource.h

minGain

Min gain (OpenAL property).

@property (readwrite, assign) float minGain

Declared In

ALSoundSource.h

muted

If true, this source is muted.

@property (readwrite, assign) bool muted

Declared In

ALSoundSource.h

pan

Pan value (-1.0 = far left, 1.0 = far right). Note: This effect is simulated by changing the source’s X position. Do not use this property if you are modifying the position property as well.

@property (readwrite, assign) float pan

Declared In

ALSoundSource.h

paused

If true, this source is currently paused.

@property (readwrite, assign) bool paused

Declared In

ALSoundSource.h

pitch

Pitch (OpenAL property).

@property (readwrite, assign) float pitch

Declared In

ALSoundSource.h

playing

If true, this source is currently playing audio.

@property (nonatomic, readonly) bool playing

Declared In

ALSoundSource.h

position

Position (OpenAL property).

@property (readwrite, assign) ALPoint position

Declared In

ALSoundSource.h

referenceDistance

Reference distance (OpenAL property).

@property (readwrite, assign) float referenceDistance

Declared In

ALSoundSource.h

rolloffFactor

Rolloff factor (OpenAL property).

@property (readwrite, assign) float rolloffFactor

Declared In

ALSoundSource.h

sourceRelative

Source relative (OpenAL property).

@property (readwrite, assign) int sourceRelative

Declared In

ALSoundSource.h

sourceType

Source type (OpenAL property).

@property (nonatomic, readonly) int sourceType

Declared In

ALSoundSource.h

velocity

Velocity (OpenAL property).

@property (readwrite, assign) ALVector velocity

Declared In

ALSoundSource.h

volume

Volume (alias to gain).

@property (readwrite, assign) float volume

Declared In

ALSoundSource.h

Instance Methods

clear

Clear any buffers this source is currently using.

- (void)clear

Declared In

ALSoundSource.h

fadeTo:duration:target:selector:

Fade to the specified gain value.

- (void)fadeTo:(float)gain duration:(float)duration target:(id)target selector:(SEL)selector

Parameters

gain

The gain to fade to.

duration

The duration of the fade operation in seconds.

target

The target to notify when the fade completes (can be nil).

selector

The selector to call when the fade completes. The selector must accept a single parameter, which will be the object that performed the fade.

Declared In

ALSoundSource.h

panTo:duration:target:selector:

pan to the specified value.

- (void)panTo:(float)pan duration:(float)duration target:(id)target selector:(SEL)selector

Parameters

pan

The value to pan to.

duration

The duration of the pan operation in seconds.

target

The target to notify when the pan completes (can be nil).

selector

The selector to call when the pan completes. The selector must accept a single parameter, which will be the object that performed the pan.

Declared In

ALSoundSource.h

pitchTo:duration:target:selector:

Gradually change pitch to the specified value.

- (void)pitchTo:(float)pitch duration:(float)duration target:(id)target selector:(SEL)selector

Parameters

pitch

The value to change pitch to.

duration

The duration of the pitch operation in seconds.

target

The target to notify when the pitch change completes (can be nil).

selector

The selector to call when the pitch change completes. The selector must accept a single parameter, which will be the object that performed the pitch change.

Declared In

ALSoundSource.h

play:

Play a sound.

- (id<ALSoundSource>)play:(ALBuffer *)buffer

Parameters

buffer

the buffer to play.

Return Value

the source playing the sound, or nil if the sound could not be played.

Declared In

ALSoundSource.h

play:gain:pitch:pan:loop:

Play a sound, setting gain, pitch, pan, and looping.

- (id<ALSoundSource>)play:(ALBuffer *)buffer gain:(float)gain pitch:(float)pitch pan:(float)pan loop:(bool)loop

Parameters

buffer

the buffer to play.

gain

The gain (volume) to play at (0.0 – 1.0).

pitch

The pitch to play at (1.0 = normal pitch).

pan

Left-right panning (-1.0 = far left, 1.0 = far right).

loop

If TRUE, the sound will loop until you call “stop” on the returned sound source.

Return Value

the source playing the sound, or nil if the sound could not be played.

Declared In

ALSoundSource.h

play:loop:

Play a sound, optionally looping.

- (id<ALSoundSource>)play:(ALBuffer *)buffer loop:(bool)loop

Parameters

buffer

the buffer to play.

loop

If TRUE, the sound will loop until you call “stop” on the returned sound source.

Return Value

the source playing the sound, or nil if the sound could not be played.

Declared In

ALSoundSource.h

rewind

Stop playing the current sound and set its state to AL_INITIAL.

- (void)rewind

Declared In

ALSoundSource.h

stop

Stop playing the current sound.

- (void)stop

Declared In

ALSoundSource.h

stopActions

Stop any currently running fade, pan, or pitch operations.

- (void)stopActions

Declared In

ALSoundSource.h

stopFade

Stop the currently running fade operation, if any.

- (void)stopFade

Declared In

ALSoundSource.h

stopPan

Stop the currently running pan operation, if any.

- (void)stopPan

Declared In

ALSoundSource.h

stopPitch

Stop the currently running pitch operation, if any.

- (void)stopPitch

Declared In

ALSoundSource.h