ALSoundSource Protocol Reference
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
property required method -
coneOuterAngle
property required method -
coneOuterGain
property required method -
direction
property required method -
gain
property required method -
volume
property required method -
interruptible
property required method -
looping
property required method -
maxDistance
property required method -
maxGain
property required method -
minGain
property required method -
muted
property required method -
paused
property required method -
pitch
property required method -
playing
property required method -
position
property required method -
referenceDistance
property required method -
rolloffFactor
property required method -
sourceRelative
property required method -
sourceType
property required method -
velocity
property required method -
pan
property required method -
reverbSendLevel
property required method -
reverbOcclusion
property required method -
reverbObstruction
property required method -
– play:
required method -
– play:loop:
required method -
– play:gain:pitch:pan:loop:
required method -
– stop
required method -
– rewind
required method -
– fadeTo:duration:target:selector:
required method -
– stopFade
required method -
– panTo:duration:target:selector:
required method -
– stopPan
required method -
– pitchTo:duration:target:selector:
required method -
– stopPitch
required method -
– stopActions
required method -
– clear
required method
Properties
coneInnerAngle
Cone inner angle (OpenAL property).
@property (nonatomic, readwrite, assign) float coneInnerAngle
Declared In
ALSoundSource.h
coneOuterAngle
Cone outer angle (OpenAL property).
@property (nonatomic, readwrite, assign) float coneOuterAngle
Declared In
ALSoundSource.h
coneOuterGain
Cone outer gain (OpenAL property).
@property (nonatomic, readwrite, assign) float coneOuterGain
Declared In
ALSoundSource.h
direction
Direction (OpenAL property).
@property (nonatomic, readwrite, assign) ALVector direction
Declared In
ALSoundSource.h
gain
Gain (volume) (OpenAL property).
@property (nonatomic, readwrite, assign) float gain
Declared In
ALSoundSource.h
interruptible
If true, this source may be interrupted when resources are low.
@property (nonatomic, readwrite, assign) bool interruptible
Declared In
ALSoundSource.h
looping
Looping (OpenAL property).
@property (nonatomic, readwrite, assign) bool looping
Declared In
ALSoundSource.h
maxDistance
Max distance (OpenAL property).
@property (nonatomic, readwrite, assign) float maxDistance
Declared In
ALSoundSource.h
maxGain
Max gain (OpenAL property).
@property (nonatomic, readwrite, assign) float maxGain
Declared In
ALSoundSource.h
minGain
Min gain (OpenAL property).
@property (nonatomic, readwrite, assign) float minGain
Declared In
ALSoundSource.h
muted
If true, this source is muted.
@property (nonatomic, 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 (nonatomic, readwrite, assign) float pan
Declared In
ALSoundSource.h
paused
If true, this source is currently paused.
@property (nonatomic, readwrite, assign) bool paused
Declared In
ALSoundSource.h
pitch
Pitch (OpenAL property).
@property (nonatomic, readwrite, assign) float pitch
Declared In
ALSoundSource.h
playing
If true, this source is currently playing audio.
@property (nonatomic, readonly, assign) bool playing
Declared In
ALSoundSource.h
position
Position (OpenAL property).
@property (nonatomic, readwrite, assign) ALPoint position
Declared In
ALSoundSource.h
referenceDistance
Reference distance (OpenAL property).
@property (nonatomic, readwrite, assign) float referenceDistance
Declared In
ALSoundSource.h
reverbObstruction
Reverb obstruction (object between listener and source). (iOS 5.0+) -100.0db (most obstruction) to 0.0 (no obstruction). Default 0.
@property (nonatomic, readwrite, assign) float reverbObstruction
Declared In
ALSoundSource.h
reverbOcclusion
Reverb occlusion (wall/door between listener and source). (iOS 5.0+) -100.0db (most occlusion) to 0.0 (no occlusion). Default 0.
@property (nonatomic, readwrite, assign) float reverbOcclusion
Declared In
ALSoundSource.h
reverbSendLevel
Reverb send level (how much reverb affects this source). (iOS 5.0+) 0.0 = fully dry, 1.0 = fully wet. Default 0.
@property (nonatomic, readwrite, assign) float reverbSendLevel
Declared In
ALSoundSource.h
rolloffFactor
Rolloff factor (OpenAL property).
@property (nonatomic, readwrite, assign) float rolloffFactor
Declared In
ALSoundSource.h
sourceRelative
Source relative (OpenAL property).
@property (nonatomic, readwrite, assign) int sourceRelative
Declared In
ALSoundSource.h
sourceType
Source type (OpenAL property).
@property (nonatomic, readonly, assign) int sourceType
Declared In
ALSoundSource.h
velocity
Velocity (OpenAL property).
@property (nonatomic, readwrite, assign) ALVector velocity
Declared In
ALSoundSource.h
volume
Volume (alias to gain).
@property (nonatomic, readwrite, assign) float volume
Declared In
ALSoundSource.h
Instance Methods
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).
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).
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:
- (id<ALSoundSource>)play:(ALBuffer *)buffer gain:(float)gain pitch:(float)pitch pan:(float)pan loop:(bool)loop
Parameters
- buffer
the buffer to play.
- 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
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