OpenALManager Class Reference
| 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
-
availableDevicesList of available playback devices (NSString*).
property -
availableCaptureDevicesList of available capture devices (NSString*).
property -
currentContextThe current context (some context operations require the context to be the “current” one).
property -
defaultCaptureDeviceSpecifierName of the default capture device.
property -
defaultDeviceSpecifierName of the default playback device.
property -
devicesList of all open devices (ALDevice*).
property -
mixerOutputFrequencyThe 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. -
– clearAllBuffersClear 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 *availableCaptureDevicesDeclared In
OpenALManager.havailableDevices
List of available playback devices (NSString*).
@property (nonatomic, readonly) NSArray *availableDevicesDeclared In
OpenALManager.hcurrentContext
The current context (some context operations require the context to be the “current” one).
@property (readwrite, assign) ALContext *currentContextDeclared In
OpenALManager.hdefaultCaptureDeviceSpecifier
Name of the default capture device.
@property (nonatomic, readonly) NSString *defaultCaptureDeviceSpecifierDeclared In
OpenALManager.hdefaultDeviceSpecifier
Name of the default playback device.
@property (nonatomic, readonly) NSString *defaultDeviceSpecifierDeclared In
OpenALManager.hInstance 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)selectorParameters
- 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.hbufferAsyncFromFile: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)selectorParameters
- 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.hbufferAsyncFromUrl: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)selectorParameters
- 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.hbufferAsyncFromUrl: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)selectorParameters
- 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.hbufferFromFile:
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 *)filePathParameters
- 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.hbufferFromFile: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)reduceToMonoParameters
- 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.hbufferFromUrl:
Load an OpenAL buffer with the contents of an audio file. The buffer’s name will be the fully qualified URL.
- (ALBuffer *)bufferFromUrl:(NSURL *)urlParameters
- 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.hbufferFromUrl: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)reduceToMonoParameters
- 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.hclearAllBuffers
Clear all references to sound data from ALL buffers, managed or not.
- (void)clearAllBuffersDeclared In
OpenALManager.h