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
-
coneInnerAngleCone inner angle (OpenAL property).
property required method -
coneOuterAngleCone outer angle (OpenAL property).
property required method -
coneOuterGainCone outer gain (OpenAL property).
property required method -
directionDirection (OpenAL property).
property required method -
gainGain (volume) (OpenAL property).
property required method -
volumeVolume (alias to gain).
property required method -
interruptibleIf true, this source may be interrupted when resources are low.
property required method -
loopingLooping (OpenAL property).
property required method -
maxDistanceMax distance (OpenAL property).
property required method -
maxGainMax gain (OpenAL property).
property required method -
minGainMin gain (OpenAL property).
property required method -
mutedIf true, this source is muted.
property required method -
pausedIf true, this source is currently paused.
property required method -
pitchPitch (OpenAL property).
property required method -
playingIf true, this source is currently playing audio.
property required method -
positionPosition (OpenAL property).
property required method -
referenceDistanceReference distance (OpenAL property).
property required method -
rolloffFactorRolloff factor (OpenAL property).
property required method -
sourceRelativeSource relative (OpenAL property).
property required method -
sourceTypeSource type (OpenAL property).
property required method -
velocityVelocity (OpenAL property).
property required method -
panPan 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 -
– stopStop playing the current sound.
required method -
– rewindStop 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 -
– stopFadeStop the currently running fade operation, if any.
required method -
– panTo:duration:target:selector:pan to the specified value.
required method -
– stopPanStop the currently running pan operation, if any.
required method -
– pitchTo:duration:target:selector:Gradually change pitch to the specified value.
required method -
– stopPitchStop the currently running pitch operation, if any.
required method -
– stopActionsStop any currently running fade, pan, or pitch operations.
required method -
– clearClear any buffers this source is currently using.
required method
Properties
coneInnerAngle
Cone inner angle (OpenAL property).
@property (readwrite, assign) float coneInnerAngleDeclared In
ALSoundSource.hconeOuterAngle
Cone outer angle (OpenAL property).
@property (readwrite, assign) float coneOuterAngleDeclared In
ALSoundSource.hconeOuterGain
Cone outer gain (OpenAL property).
@property (readwrite, assign) float coneOuterGainDeclared In
ALSoundSource.hdirection
Direction (OpenAL property).
@property (readwrite, assign) ALVector directionDeclared In
ALSoundSource.hgain
Gain (volume) (OpenAL property).
@property (readwrite, assign) float gainDeclared In
ALSoundSource.hinterruptible
If true, this source may be interrupted when resources are low.
@property (readwrite, assign) bool interruptibleDeclared In
ALSoundSource.hlooping
Looping (OpenAL property).
@property (readwrite, assign) bool loopingDeclared In
ALSoundSource.hmaxDistance
Max distance (OpenAL property).
@property (readwrite, assign) float maxDistanceDeclared In
ALSoundSource.hmaxGain
Max gain (OpenAL property).
@property (readwrite, assign) float maxGainDeclared In
ALSoundSource.hminGain
Min gain (OpenAL property).
@property (readwrite, assign) float minGainDeclared In
ALSoundSource.hmuted
If true, this source is muted.
@property (readwrite, assign) bool mutedDeclared In
ALSoundSource.hpan
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 panDeclared In
ALSoundSource.hpaused
If true, this source is currently paused.
@property (readwrite, assign) bool pausedDeclared In
ALSoundSource.hpitch
Pitch (OpenAL property).
@property (readwrite, assign) float pitchDeclared In
ALSoundSource.hplaying
If true, this source is currently playing audio.
@property (nonatomic, readonly) bool playingDeclared In
ALSoundSource.hposition
Position (OpenAL property).
@property (readwrite, assign) ALPoint positionDeclared In
ALSoundSource.hreferenceDistance
Reference distance (OpenAL property).
@property (readwrite, assign) float referenceDistanceDeclared In
ALSoundSource.hrolloffFactor
Rolloff factor (OpenAL property).
@property (readwrite, assign) float rolloffFactorDeclared In
ALSoundSource.hsourceRelative
Source relative (OpenAL property).
@property (readwrite, assign) int sourceRelativeDeclared In
ALSoundSource.hsourceType
Source type (OpenAL property).
@property (nonatomic, readonly) int sourceTypeDeclared In
ALSoundSource.hInstance Methods
fadeTo:duration:target:selector:
Fade to the specified gain value.
- (void)fadeTo:(float)gain duration:(float)duration target:(id)target selector:(SEL)selectorParameters
- 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.hpanTo:duration:target:selector:
pan to the specified value.
- (void)panTo:(float)pan duration:(float)duration target:(id)target selector:(SEL)selectorParameters
- 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.hpitchTo:duration:target:selector:
Gradually change pitch to the specified value.
- (void)pitchTo:(float)pitch duration:(float)duration target:(id)target selector:(SEL)selectorParameters
- 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.hplay:
Play a sound.
- (id<ALSoundSource>)play:(ALBuffer *)bufferParameters
- buffer
the buffer to play.
Return Value
the source playing the sound, or nil if the sound could not be played.
Declared In
ALSoundSource.hplay: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)loopParameters
- 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.hplay:loop:
Play a sound, optionally looping.
- (id<ALSoundSource>)play:(ALBuffer *)buffer loop:(bool)loopParameters
- 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.hrewind
Stop playing the current sound and set its state to AL_INITIAL.
- (void)rewindDeclared In
ALSoundSource.hstopActions
Stop any currently running fade, pan, or pitch operations.
- (void)stopActionsDeclared In
ALSoundSource.hstopFade
Stop the currently running fade operation, if any.
- (void)stopFadeDeclared In
ALSoundSource.h