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
-
bufferThe sound buffer this source is attached to (set to nil to detach the currently attached buffer).
property -
buffersQueuedHow many buffers this source has queued.
property -
buffersProcessedHow many of these buffers have been processed during playback.
property -
contextThe context this source was opened on.
property -
offsetInBytesThe offset into the current buffer (in bytes).
property -
offsetInSamplesThe offset into the current buffer (in samples).
property -
offsetInSecondsThe offset into the current buffer (in seconds).
property -
sourceIdOpenAL’s ID for this source.
property -
stateThe state of this source.
property -
+ sourceCreate a new source.
-
+ sourceOnContext:Create a new source on the specified context.
-
– initOnContext:Initialize a new source on the specified context.
-
– playPlay 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 *bufferDeclared In
ALSource.hbuffersProcessed
How many of these buffers have been processed during playback.
@property (nonatomic, readonly) int buffersProcessedDeclared In
ALSource.hbuffersQueued
How many buffers this source has queued.
@property (nonatomic, readonly) int buffersQueuedDeclared In
ALSource.hcontext
The context this source was opened on.
@property (nonatomic, readonly) ALContext *contextDeclared In
ALSource.hoffsetInBytes
The offset into the current buffer (in bytes).
@property (readwrite, assign) float offsetInBytesDeclared In
ALSource.hoffsetInSamples
The offset into the current buffer (in samples).
@property (readwrite, assign) float offsetInSamplesDeclared In
ALSource.hoffsetInSeconds
The offset into the current buffer (in seconds).
@property (readwrite, assign) float offsetInSecondsDeclared In
ALSource.hInstance Methods
initOnContext:
Initialize a new source on the specified context.
- (id)initOnContext:(ALContext *)contextParameters
- context
the context to create the source on.
Return Value
A new source.
Declared In
ALSource.hplay
Play the currently attached buffer.
- (id<ALSoundSource>)playReturn Value
the source playing the sound, or nil if the sound could not be played.
Declared In
ALSource.hqueueBuffer:
Add a buffer to the buffer queue.
- (bool)queueBuffer:(ALBuffer *)bufferParameters
- buffer
the buffer to add to the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.hqueueBuffer:repeats:
Add a buffer to the buffer queue, repeating it multiple times.
- (bool)queueBuffer:(ALBuffer *)buffer repeats:(NSUInteger)repeatsParameters
- 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.hqueueBuffers:
Add buffers to the buffer queue.
- (bool)queueBuffers:(NSArray *)buffersParameters
- buffers
the buffers to add to the queue.
Return Value
TRUE if the operation was successful.
Declared In
ALSource.hqueueBuffers: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)repeatsParameters
- 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