Inherits from NSObject
Conforms to OALSuspendManager
Declared in OpenALManager.h

Overview

Manager class for OpenAL objects (ObjectAL). Keeps track of devices that have been opened, and allows high level OpenAL management.
Provides methods for loading ALBuffer objects from audio files.
The OpenAL 1.1 specification is available at http://connect.creativelabs.com/openal/Documentation
Be sure to read through it (especially the part about distance models) as ObjectAL follows the OpenAL object model.

Alternatively, you may opt to use OALSimpleAudio for a simpler interface.

Tasks

  •   availableDevices

    List of available playback devices (NSString*).

    property
  •   availableCaptureDevices

    List of available capture devices (NSString*).

    property
  •   currentContext

    The current context (some context operations require the context to be the “current” one).

    property
  •   defaultCaptureDeviceSpecifier

    Name of the default capture device.

    property
  •   defaultDeviceSpecifier

    Name of the default playback device.

    property
  •   devices

    List of all open devices (ALDevice*).

    property
  •   mixerOutputFrequency

    The frequency of the output mixer.

    property
  • – bufferFromFile:

    Load an OpenAL buffer with the contents of an audio file. The buffer’s name will be the fully qualified URL of the path.

  • – bufferFromFile:reduceToMono:

    Load an OpenAL buffer with the contents of an audio file. The buffer’s name will be the fully qualified URL of the path.

  • – bufferFromUrl:

    Load an OpenAL buffer with the contents of an audio file. The buffer’s name will be the fully qualified URL.

  • – bufferFromUrl:reduceToMono:

    Load an OpenAL buffer with the contents of an audio file. The buffer’s name will be the fully qualified URL.

  • – bufferAsyncFromFile:target:selector:

    Load an OpenAL buffer with the contents of an audio file asynchronously. This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
    The buffer’s name will be the fully qualified URL of the path.
    Returns the fully qualified URL of the path, which you can match up to the buffer name in your callback method.

  • – bufferAsyncFromFile:reduceToMono:target:selector:

    Load an OpenAL buffer with the contents of an audio file asynchronously. This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
    The buffer’s name will be the fully qualified URL of the path.
    Returns the fully qualified URL of the path, which you can match up to the buffer name in your callback method.

  • – bufferAsyncFromUrl:target:selector:

    Load an OpenAL buffer with the contents of a URL asynchronously. This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
    The buffer’s name will be the fully qualified URL.
    Returns the fully qualified URL, which you can match up to the buffer name in your callback method.

  • – bufferAsyncFromUrl:reduceToMono:target:selector:

    Load an OpenAL buffer with the contents of a URL asynchronously. This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
    The buffer’s name will be the fully qualified URL.
    Returns the fully qualified URL, which you can match up to the buffer name in your callback method.

  • – clearAllBuffers

    Clear all references to sound data from ALL buffers, managed or not.

  • – notifyDeviceInitializing:

    (INTERNAL USE) Notify that a device is initializing.

  • – notifyDeviceDeallocating:

    (INTERNAL USE) Notify that a device is deallocating.

Properties

availableCaptureDevices

List of available capture devices (NSString*).

@property (nonatomic, readonly) NSArray *availableCaptureDevices

Declared In

OpenALManager.h

availableDevices

List of available playback devices (NSString*).

@property (nonatomic, readonly) NSArray *availableDevices

Declared In

OpenALManager.h

currentContext

The current context (some context operations require the context to be the “current” one).

@property (readwrite, assign) ALContext *currentContext

Declared In

OpenALManager.h

defaultCaptureDeviceSpecifier

Name of the default capture device.

@property (nonatomic, readonly) NSString *defaultCaptureDeviceSpecifier

Declared In

OpenALManager.h

defaultDeviceSpecifier

Name of the default playback device.

@property (nonatomic, readonly) NSString *defaultDeviceSpecifier

Declared In

OpenALManager.h

devices

List of all open devices (ALDevice*).

@property (nonatomic, readonly) NSArray *devices

Declared In

OpenALManager.h

mixerOutputFrequency

The frequency of the output mixer.

@property (readwrite, assign) ALdouble mixerOutputFrequency

Declared In

OpenALManager.h

Instance Methods

bufferAsyncFromFile:reduceToMono:target:selector:

Load an OpenAL buffer with the contents of an audio file asynchronously. This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
The buffer’s name will be the fully qualified URL of the path.
Returns the fully qualified URL of the path, which you can match up to the buffer name in your callback method.

- (NSString *)bufferAsyncFromFile:(NSString *)filePath reduceToMono:(bool)reduceToMono target:(id)target selector:(SEL)selector

Parameters

filePath

The path of the file containing the audio data.

reduceToMono

If true, reduce the sample to mono (stereo samples don’t support panning or positional audio).

target

The target to call when the buffer is loaded.

selector

The selector to invoke when the buffer is loaded.

Return Value

The fully qualified URL of the path.

Discussion

See the class description note regarding sound file formats.

Declared In

OpenALManager.h

bufferAsyncFromFile:target:selector:

Load an OpenAL buffer with the contents of an audio file asynchronously. This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
The buffer’s name will be the fully qualified URL of the path.
Returns the fully qualified URL of the path, which you can match up to the buffer name in your callback method.

- (NSString *)bufferAsyncFromFile:(NSString *)filePath target:(id)target selector:(SEL)selector

Parameters

filePath

The path of the file containing the audio data.

target

The target to call when the buffer is loaded.

selector

The selector to invoke when the buffer is loaded.

Return Value

The fully qualified URL of the path.

Discussion

See the class description note regarding sound file formats.

Declared In

OpenALManager.h

bufferAsyncFromUrl:reduceToMono:target:selector:

Load an OpenAL buffer with the contents of a URL asynchronously. This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
The buffer’s name will be the fully qualified URL.
Returns the fully qualified URL, which you can match up to the buffer name in your callback method.

- (NSString *)bufferAsyncFromUrl:(NSURL *)url reduceToMono:(bool)reduceToMono target:(id)target selector:(SEL)selector

Parameters

url

The URL of the file containing the audio data.

reduceToMono

If true, reduce the sample to mono (stereo samples don’t support panning or positional audio).

target

The target to call when the buffer is loaded.

selector

The selector to invoke when the buffer is loaded.

Return Value

The fully qualified URL of the path.

Discussion

See the class description note regarding sound file formats.

Declared In

OpenALManager.h

bufferAsyncFromUrl:target:selector:

Load an OpenAL buffer with the contents of a URL asynchronously. This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
The buffer’s name will be the fully qualified URL.
Returns the fully qualified URL, which you can match up to the buffer name in your callback method.

- (NSString *)bufferAsyncFromUrl:(NSURL *)url target:(id)target selector:(SEL)selector

Parameters

url

The URL of the file containing the audio data.

target

The target to call when the buffer is loaded.

selector

The selector to invoke when the buffer is loaded.

Return Value

The fully qualified URL of the path.

Discussion

See the class description note regarding sound file formats.

Declared In

OpenALManager.h

bufferFromFile:

Load an OpenAL buffer with the contents of an audio file. The buffer’s name will be the fully qualified URL of the path.

- (ALBuffer *)bufferFromFile:(NSString *)filePath

Parameters

filePath

The path of the file containing the audio data.

Return Value

An ALBuffer containing the audio data.

Discussion

See the class description note regarding sound file formats.

Declared In

OpenALManager.h

bufferFromFile:reduceToMono:

Load an OpenAL buffer with the contents of an audio file. The buffer’s name will be the fully qualified URL of the path.

- (ALBuffer *)bufferFromFile:(NSString *)filePath reduceToMono:(bool)reduceToMono

Parameters

filePath

The path of the file containing the audio data.

reduceToMono

If true, reduce the sample to mono (stereo samples don’t support panning or positional audio).

Return Value

An ALBuffer containing the audio data.

Discussion

See the class description note regarding sound file formats.

Declared In

OpenALManager.h

bufferFromUrl:

Load an OpenAL buffer with the contents of an audio file. The buffer’s name will be the fully qualified URL.

- (ALBuffer *)bufferFromUrl:(NSURL *)url

Parameters

url

The URL of the file containing the audio data.

Return Value

An ALBuffer containing the audio data.

Discussion

See the class description note regarding sound file formats.

Declared In

OpenALManager.h

bufferFromUrl:reduceToMono:

Load an OpenAL buffer with the contents of an audio file. The buffer’s name will be the fully qualified URL.

- (ALBuffer *)bufferFromUrl:(NSURL *)url reduceToMono:(bool)reduceToMono

Parameters

url

The URL of the file containing the audio data.

reduceToMono

If true, reduce the sample to mono (stereo samples don’t support panning or positional audio).

Return Value

An ALBuffer containing the audio data.

Discussion

See the class description note regarding sound file formats.

Declared In

OpenALManager.h

clearAllBuffers

Clear all references to sound data from ALL buffers, managed or not.

- (void)clearAllBuffers

Declared In

OpenALManager.h

notifyDeviceDeallocating:

(INTERNAL USE) Notify that a device is deallocating.

- (void)notifyDeviceDeallocating:(ALDevice *)device

Declared In

OpenALManager.h

notifyDeviceInitializing:

(INTERNAL USE) Notify that a device is initializing.

- (void)notifyDeviceInitializing:(ALDevice *)device

Declared In

OpenALManager.h