ALSource Class Reference
Inherits from | NSObject |
Conforms to | ALSoundSource OALSuspendManager |
Declared in | ALSource.h |
Overview
A source represents an object that emits sound which can be heard by a listener. This source can have position, velocity, and direction.
Tasks
-
buffer
The sound buffer this source is attached to (set to nil to detach the currently attached buffer).
property -
buffersQueued
How many buffers this source has queued.
property -
buffersProcessed
How many of these buffers have been processed during playback.
property -
context
The context this source was opened on.
property -
offsetInBytes
The offset into the current buffer (in bytes).
property -
offsetInSamples
The offset into the current buffer (in samples).
property -
offsetInSeconds
The offset into the current buffer (in seconds).
property -
sourceId
OpenAL’s ID for this source.
property -
state
The state of this source.
property -
+ source
Create a new source.
-
+ sourceOnContext:
Create a new source on the specified context.
-
– initOnContext:
Initialize a new source on the specified context.
-
– play
Play the currently attached buffer.
-
– queueBuffer:
Add a buffer to the buffer queue.
-
– queueBuffer:repeats:
Add a buffer to the buffer queue, repeating it multiple times.
-
– queueBuffers:
Add buffers to the buffer queue.
-
– queueBuffers:repeats:
Add buffers to the buffer queue, repeating it multiple times. The buffers will be played in order, repeating the specified number of times.
-
– unqueueBuffer:
Remove a buffer from the buffer queue.
-
– unqueueBuffers:
Remove buffers from the buffer queue
Properties
buffer
The sound buffer this source is attached to (set to nil to detach the currently attached buffer).
@property (readwrite, retain) ALBuffer *buffer
Declared In
ALSource.h
buffersProcessed
How many of these buffers have been processed during playback.
@property (nonatomic, readonly) int buffersProcessed
Declared In
ALSource.h
buffersQueued
How many buffers this source has queued.
@property (nonatomic, readonly) int buffersQueued
Declared In
ALSource.h
context
The context this source was opened on.
@property (nonatomic, readonly) ALContext *context
Declared In
ALSource.h
offsetInBytes
The offset into the current buffer (in bytes).
@property (readwrite, assign) float offsetInBytes
Declared In
ALSource.h
offsetInSamples
The offset into the current buffer (in samples).
@property (readwrite, assign) float offsetInSamples
Declared In
ALSource.h
offsetInSeconds
The offset into the current buffer (in seconds).
@property (readwrite, assign) float offsetInSeconds
Declared In
ALSource.h
Instance Methods
initOnContext:
Initialize a new source on the specified context.
- (id)initOnContext:(ALContext *)context
Parameters
- context
the context to create the source on.
Return Value
A new source.
Declared In
ALSource.h
play
Play the currently attached buffer.
- (id<ALSoundSource>)play
Return Value
the source playing the sound, or nil if the sound could not be played.
Declared In
ALSource.h
queueBuffer:
Add a buffer to the buffer queue.
- (bool)queueBuffer:(ALBuffer *)buffer
Parameters
- buffer
the buffer to add to the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.h
queueBuffer:repeats:
Add a buffer to the buffer queue, repeating it multiple times.
- (bool)queueBuffer:(ALBuffer *)buffer repeats:(NSUInteger)repeats
Parameters
- buffer
the buffer to add to the queue.
- repeats
the number of times to repeat the buffer in the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.h
queueBuffers:
Add buffers to the buffer queue.
- (bool)queueBuffers:(NSArray *)buffers
Parameters
- buffers
the buffers to add to the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.h
queueBuffers:repeats:
Add buffers to the buffer queue, repeating it multiple times. The buffers will be played in order, repeating the specified number of times.
- (bool)queueBuffers:(NSArray *)buffers repeats:(NSUInteger)repeats
Parameters
- buffers
the buffers to add to the queue.
- repeats
the number of times to repeat the buffer in the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.h