A buffer for audio data that will be played via a SoundSource.
More...
#import <ALBuffer.h>
A buffer for audio data that will be played via a SoundSource.
- See Also
- SoundSource
+ (id) bufferWithName: |
|
(NSString*) |
name |
data: |
|
(void*) |
data |
size: |
|
(ALsizei) |
size |
format: |
|
(ALenum) |
format |
frequency: |
|
(ALsizei) |
frequency |
|
|
| |
Make a new buffer.
- Parameters
-
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. |
- Returns
- A new buffer.
- (id) initWithName: |
|
(NSString*) |
name |
data: |
|
(void*) |
data |
size: |
|
(ALsizei) |
size |
format: |
|
(ALenum) |
format |
frequency: |
|
(ALsizei) |
frequency |
|
|
| |
Initialize the buffer.
- Parameters
-
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. |
- Returns
- The initialized buffer.
- (ALBuffer *) sliceWithName: |
|
(NSString *) |
sliceName |
offset: |
|
(ALsizei) |
offset |
size: |
|
(ALsizei) |
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.
- Parameters
-
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. |
- Returns
- The requested buffer.
The uncompressed sound data to play.
The parent buffer (which owns the uncompressed data)
The size of a sample in bits.
The ID assigned to this buffer by OpenAL.
The number of channels the buffer data plays in.
The device this buffer was created for.
The duration of the sample in this buffer, in seconds.
The format of the audio data (see al.h, AL_FORMAT_XXX).
- (bool) freeDataOnDestroy |
|
readwritenonatomicassign |
If true, calls free() on the audio data when this object gets destroyed.
Default: YES
The frequency this buffer runs at.
The name given to this buffer upon creation.
You may change it at runtime if you wish.
The size, in bytes, of the currently loaded buffer data.
The documentation for this class was generated from the following files: