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

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

sourceId

OpenAL’s ID for this source.

@property (nonatomic, readonly) ALuint sourceId

Declared In

ALSource.h

state

The state of this source.

@property (readwrite, assign) int state

Declared In

ALSource.h

Class Methods

source

Create a new source.

+ (id)source

Return Value

A new source.

Declared In

ALSource.h

sourceOnContext:

Create a new source on the specified context.

+ (id)sourceOnContext:(ALContext *)context

Parameters

context

the context to create the source on.

Return Value

A new source.

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

unqueueBuffer:

Remove a buffer from the buffer queue.

- (bool)unqueueBuffer:(ALBuffer *)buffer

Parameters

buffer

the buffer to remove from the queue.

Return Value

TRUE if the operation was successful.

Declared In

ALSource.h

unqueueBuffers:

Remove buffers from the buffer queue

- (bool)unqueueBuffers:(NSArray *)buffers

Parameters

buffers

the buffers to remove from the queue.

Return Value

TRUE if the operation was successful.

Declared In

ALSource.h