ObjectAL
 All Classes Functions Variables Properties Pages
Instance Methods | Properties | List of all members
<ALSoundSource> Protocol Referenceabstract

Manages all properties relating to an OpenAL sound source. More...

#import <ALSoundSource.h>

Inheritance diagram for <ALSoundSource>:
ALChannelSource ALSource

Instance Methods

(id< ALSoundSource >) - play:
 Play a sound. More...
 
(id< ALSoundSource >) - play:loop:
 Play a sound, optionally looping. More...
 
(id< ALSoundSource >) - play:gain:pitch:pan:loop:
 Play a sound, setting gain, pitch, pan, and looping. More...
 
(void) - stop
 Stop playing the current sound. More...
 
(void) - rewind
 Stop playing the current sound and set its state to AL_INITIAL. More...
 
(void) - fadeTo:duration:target:selector:
 Fade to the specified gain value. More...
 
(void) - stopFade
 Stop the currently running fade operation, if any. More...
 
(void) - panTo:duration:target:selector:
 pan to the specified value. More...
 
(void) - stopPan
 Stop the currently running pan operation, if any. More...
 
(void) - pitchTo:duration:target:selector:
 Gradually change pitch to the specified value. More...
 
(void) - stopPitch
 Stop the currently running pitch operation, if any. More...
 
(void) - stopActions
 Stop any currently running fade, pan, or pitch operations. More...
 
(void) - clear
 Clear any buffers this source is currently using. More...
 

Properties

float coneInnerAngle
 Cone inner angle (OpenAL property). More...
 
float coneOuterAngle
 Cone outer angle (OpenAL property). More...
 
float coneOuterGain
 Cone outer gain (OpenAL property). More...
 
ALVector direction
 Direction (OpenAL property). More...
 
float gain
 Gain (volume) (OpenAL property). More...
 
float volume
 Volume (alias to gain). More...
 
bool interruptible
 If true, this source may be interrupted when resources are low. More...
 
bool looping
 Looping (OpenAL property). More...
 
float maxDistance
 Max distance (OpenAL property). More...
 
float maxGain
 Max gain (OpenAL property). More...
 
float minGain
 Min gain (OpenAL property). More...
 
bool muted
 If true, this source is muted. More...
 
bool paused
 If true, this source is currently paused. More...
 
float pitch
 Pitch (OpenAL property). More...
 
bool playing
 If true, this source is currently playing audio. More...
 
ALPoint position
 Position (OpenAL property). More...
 
float referenceDistance
 Reference distance (OpenAL property). More...
 
float rolloffFactor
 Rolloff factor (OpenAL property). More...
 
int sourceRelative
 Source relative (OpenAL property). More...
 
int sourceType
 Source type (OpenAL property). More...
 
ALVector velocity
 Velocity (OpenAL property). More...
 
float pan
 Pan value (-1.0 = far left, 1.0 = far right). More...
 
float reverbSendLevel
 Reverb send level (how much reverb affects this source). More...
 
float reverbOcclusion
 Reverb occlusion (wall/door between listener and source). More...
 
float reverbObstruction
 Reverb obstruction (object between listener and source). More...
 

Detailed Description

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

Method Documentation

- (void) clear

Clear any buffers this source is currently using.

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

Fade to the specified gain value.

Parameters
gainThe gain to fade to.
durationThe duration of the fade operation in seconds.
targetThe target to notify when the fade completes (can be nil).
selectorThe selector to call when the fade completes. The selector must accept a single parameter, which will be the object that performed the fade.
- (void) panTo: (float)  pan
duration: (float)  duration
target: (id)  target
selector: (SEL)  selector 

pan to the specified value.

Parameters
panThe value to pan to.
durationThe duration of the pan operation in seconds.
targetThe target to notify when the pan completes (can be nil).
selectorThe selector to call when the pan completes. The selector must accept a single parameter, which will be the object that performed the pan.
- (void) pitchTo: (float)  pitch
duration: (float)  duration
target: (id)  target
selector: (SEL)  selector 

Gradually change pitch to the specified value.

Parameters
pitchThe value to change pitch to.
durationThe duration of the pitch operation in seconds.
targetThe target to notify when the pitch change completes (can be nil).
selectorThe 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.
- (id<ALSoundSource>) play: (ALBuffer *)  buffer

Play a sound.

Parameters
bufferthe buffer to play.
Returns
the source playing the sound, or nil if the sound could not be played.
- (id<ALSoundSource>) play: (ALBuffer *)  buffer
gain: (float)  gain
pitch: (float)  pitch
pan: (float)  pan
loop: (bool)  loop 

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

Parameters
bufferthe buffer to play.
gainThe gain (volume) to play at (0.0 - 1.0).
pitchThe pitch to play at (1.0 = normal pitch).
panLeft-right panning (-1.0 = far left, 1.0 = far right).
loopIf TRUE, the sound will loop until you call "stop" on the returned sound source.
Returns
the source playing the sound, or nil if the sound could not be played.
- (id<ALSoundSource>) play: (ALBuffer *)  buffer
loop: (bool)  loop 

Play a sound, optionally looping.

Parameters
bufferthe buffer to play.
loopIf TRUE, the sound will loop until you call "stop" on the returned sound source.
Returns
the source playing the sound, or nil if the sound could not be played.
- (void) rewind

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

- (void) stop

Stop playing the current sound.

- (void) stopActions

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

- (void) stopFade

Stop the currently running fade operation, if any.

- (void) stopPan

Stop the currently running pan operation, if any.

- (void) stopPitch

Stop the currently running pitch operation, if any.

Property Documentation

- (float) coneInnerAngle
readwritenonatomicassign

Cone inner angle (OpenAL property).

- (float) coneOuterAngle
readwritenonatomicassign

Cone outer angle (OpenAL property).

- (float) coneOuterGain
readwritenonatomicassign

Cone outer gain (OpenAL property).

- (ALVector) direction
readwritenonatomicassign

Direction (OpenAL property).

- (float) gain
readwritenonatomicassign

Gain (volume) (OpenAL property).

- (bool) interruptible
readwritenonatomicassign

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

- (bool) looping
readwritenonatomicassign

Looping (OpenAL property).

- (float) maxDistance
readwritenonatomicassign

Max distance (OpenAL property).

- (float) maxGain
readwritenonatomicassign

Max gain (OpenAL property).

- (float) minGain
readwritenonatomicassign

Min gain (OpenAL property).

- (bool) muted
readwritenonatomicassign

If true, this source is muted.

- (float) pan
readwritenonatomicassign

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.

- (bool) paused
readwritenonatomicassign

If true, this source is currently paused.

- (float) pitch
readwritenonatomicassign

Pitch (OpenAL property).

- (bool) playing
readnonatomicassign

If true, this source is currently playing audio.

- (ALPoint) position
readwritenonatomicassign

Position (OpenAL property).

- (float) referenceDistance
readwritenonatomicassign

Reference distance (OpenAL property).

- (float) reverbObstruction
readwritenonatomicassign

Reverb obstruction (object between listener and source).

(iOS 5.0+) -100.0db (most obstruction) to 0.0 (no obstruction). Default 0.

- (float) reverbOcclusion
readwritenonatomicassign

Reverb occlusion (wall/door between listener and source).

(iOS 5.0+) -100.0db (most occlusion) to 0.0 (no occlusion). Default 0.

- (float) reverbSendLevel
readwritenonatomicassign

Reverb send level (how much reverb affects this source).

(iOS 5.0+) 0.0 = fully dry, 1.0 = fully wet. Default 0.

- (float) rolloffFactor
readwritenonatomicassign

Rolloff factor (OpenAL property).

- (int) sourceRelative
readwritenonatomicassign

Source relative (OpenAL property).

- (int) sourceType
readnonatomicassign

Source type (OpenAL property).

- (ALVector) velocity
readwritenonatomicassign

Velocity (OpenAL property).

- (float) volume
readwritenonatomicassign

Volume (alias to gain).


The documentation for this protocol was generated from the following file: