ALBuffer Class Reference
| Inherits from | NSObject |
| Declared in | ALBuffer.h |
Tasks
-
bitsThe size of a sample in bits.
property -
bufferIdThe ID assigned to this buffer by OpenAL.
property -
channelsThe number of channels the buffer data plays in.
property -
deviceThe device this buffer was created for.
property -
formatThe format of the audio data (see al.h, AL_FORMAT_XXX).
property -
frequencyThe frequency this buffer runs at.
property -
nameThe name given to this buffer upon creation. You may change it at runtime if you wish.
property -
sizeThe size, in bytes, of the currently loaded buffer data.
property -
durationThe duration of the sample in this buffer, in seconds.
property -
freeDataOnDestroyIf true, calls free() on the audio data when this object gets destroyed. Default: YES
property -
+ bufferWithName:data:size:format:frequency:Make a new buffer.
-
– initWithName:data:size:format:frequency:Initialize the buffer.
-
– sliceWithName:offset:size:Returns a part of the buffer as a new buffer. You can use this method to split a buffer into a sub-buffers. The sub-buffers retain a reference to their parent buffer, and share the same memory. Therefore, modifying the parent buffer contents will affect its slices and vice-versa.
Properties
bits
The size of a sample in bits.
@property (nonatomic, readonly) ALint bitsDeclared In
ALBuffer.hbufferId
The ID assigned to this buffer by OpenAL.
@property (nonatomic, readonly) ALuint bufferIdDeclared In
ALBuffer.hchannels
The number of channels the buffer data plays in.
@property (nonatomic, readonly) ALint channelsDeclared In
ALBuffer.hdevice
The device this buffer was created for.
@property (nonatomic, readonly) ALDevice *deviceDeclared In
ALBuffer.hduration
The duration of the sample in this buffer, in seconds.
@property (nonatomic, readonly) float durationDeclared In
ALBuffer.hformat
The format of the audio data (see al.h, AL_FORMAT_XXX).
@property (nonatomic, readonly) ALenum formatDeclared In
ALBuffer.hfreeDataOnDestroy
If true, calls free() on the audio data when this object gets destroyed. Default: YES
@property (nonatomic, readwrite, assign) bool freeDataOnDestroyDeclared In
ALBuffer.hfrequency
The frequency this buffer runs at.
@property (nonatomic, readonly) ALint frequencyDeclared In
ALBuffer.hClass Methods
bufferWithName:data:size:format:frequency:
Make a new buffer.
+ (id)bufferWithName:(NSString *)name data:(void *)data size:(ALsizei)size format:(ALenum)format frequency:(ALsizei)frequencyParameters
- name
Optional name that you can use to identify this buffer in your code.
- data
The sound data. Note: ALBuffer will call free() on this data when it is destroyed!
- size
The size of the data in bytes.
- format
The format of the data (see the Core Audio documentation).
- frequency
The sampling frequency in Hz.
Return Value
A new buffer.
Declared In
ALBuffer.hInstance Methods
initWithName:data:size:format:frequency:
Initialize the buffer.
- (id)initWithName:(NSString *)name data:(void *)data size:(ALsizei)size format:(ALenum)format frequency:(ALsizei)frequencyParameters
- name
Optional name that you can use to identify this buffer in your code.
- data
The sound data. Note: ALBuffer will call free() on this data when it is destroyed!
- size
The size of the data in bytes.
- format
The format of the data (see the Core Audio documentation).
- frequency
The sampling frequency in Hz.
Return Value
The initialized buffer.
Declared In
ALBuffer.hsliceWithName:offset:size:
Returns a part of the buffer as a new buffer. You can use this method to split a buffer into a sub-buffers. The sub-buffers retain a reference to their parent buffer, and share the same memory. Therefore, modifying the parent buffer contents will affect its slices and vice-versa.
- (ALBuffer *)sliceWithName:(NSString *)sliceName offset:(ALsizei)offset size:(ALsizei)sizeParameters
- sliceName
Optional name that you can use to identify the created buffer in your code.
- offset
The offset in sound frames where the slice starts.
- size
The size of the slice in frames.
Return Value
The requested buffer.
Declared In
ALBuffer.h