|
ObjectAL
2.1
ObjectAL API Reference (iOS) for Kobold2D developers
|
A buffer for audio data that will be played via a SoundSource. More...
#include <ALBuffer.h>
Public Member Functions | |
| id | initWithName:data:size:format:frequency: (NSString *name,[data] void *data,[size] ALsizei size,[format] ALenum format,[frequency] ALsizei frequency) |
| Initialize the buffer. | |
| ALBuffer * | sliceWithName:offset:size: (NSString *sliceName,[offset] ALsizei offset,[size] ALsizei size) |
| Returns a part of the buffer as a new buffer. | |
Static Public Member Functions | |
| id | bufferWithName:data:size:format:frequency: (NSString *name,[data] void *data,[size] ALsizei size,[format] ALenum format,[frequency] ALsizei frequency) |
| Make a new buffer. | |
Protected Attributes | |
| void * | bufferData |
| The uncompressed sound data to play. | |
| ALBuffer * | parentBuffer |
| The parent buffer (which owns the uncompressed data) | |
Properties | |
| ALint | bits |
| The size of a sample in bits. | |
| ALuint | bufferId |
| The ID assigned to this buffer by OpenAL. | |
| ALint | channels |
| The number of channels the buffer data plays in. | |
| ALDevice * | device |
| The device this buffer was created for. | |
| ALenum | format |
| The format of the audio data (see al.h, AL_FORMAT_XXX). | |
| ALint | frequency |
| The frequency this buffer runs at. | |
| NSString * | name |
| The name given to this buffer upon creation. | |
| ALint | size |
| The size, in bytes, of the currently loaded buffer data. | |
| float | duration |
| The duration of the sample in this buffer, in seconds. | |
| bool | freeDataOnDestroy |
| If true, calls free() on the audio data when this object gets destroyed. | |
A buffer for audio data that will be played via a SoundSource.
| id ALBuffer::bufferWithName:data:size:format:frequency: | ( | NSString* | name, |
| [data] void* | data, | ||
| [size] ALsizei | size, | ||
| [format] ALenum | format, | ||
| [frequency] ALsizei | frequency | ||
| ) | [static, virtual] |
Make a new buffer.
| 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. |
| id ALBuffer::initWithName:data:size:format:frequency: | ( | NSString* | name, |
| [data] void* | data, | ||
| [size] ALsizei | size, | ||
| [format] ALenum | format, | ||
| [frequency] ALsizei | frequency | ||
| ) | [virtual] |
Initialize the buffer.
| 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. |
| ALBuffer * ALBuffer::sliceWithName:offset:size: | ( | NSString * | sliceName, |
| [offset] ALsizei | offset, | ||
| [size] ALsizei | size | ||
| ) | [virtual] |
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.
| 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. |
void* ALBuffer::bufferData [protected] |
The uncompressed sound data to play.
ALBuffer* ALBuffer::parentBuffer [protected] |
The parent buffer (which owns the uncompressed data)
ALint ALBuffer::bits [read, assign] |
The size of a sample in bits.
ALuint ALBuffer::bufferId [read, assign] |
The ID assigned to this buffer by OpenAL.
ALint ALBuffer::channels [read, assign] |
The number of channels the buffer data plays in.
ALDevice * ALBuffer::device [read, assign] |
The device this buffer was created for.
float ALBuffer::duration [read, assign] |
The duration of the sample in this buffer, in seconds.
ALenum ALBuffer::format [read, assign] |
The format of the audio data (see al.h, AL_FORMAT_XXX).
bool ALBuffer::freeDataOnDestroy [read, write, assign] |
If true, calls free() on the audio data when this object gets destroyed.
Default: YES
ALint ALBuffer::frequency [read, assign] |
The frequency this buffer runs at.
NSString * ALBuffer::name [read, write, retain] |
The name given to this buffer upon creation.
You may change it at runtime if you wish.
ALint ALBuffer::size [read, assign] |
The size, in bytes, of the currently loaded buffer data.