alcOpenDevice : This takes a string as input.which is either the name of a valid OpenAL rendering device, or NULL to request the default device.
ALCdevice *alcOpenDevice(
const ALCchar *devicename
);
alcCreateContext : function creates the context with specified device
ALCcontext * alcCreateContext(
ALCdevice *device,
ALCint* attrlist
);
device : a pointer to a device
attrlist : a pointer to a set of attributes
ALC_FREQUENCY
ALC_MONO_SOURCES
ALC_REFRESH
ALC_STEREO_SOURCES
ALC_SYNC
alGenBuffers : this is used to generate the number of buffers desired.
void alGenBuffers(
ALsizei n,
ALuint *buffers
);
alBufferData : fills the buffers with audio data.
void alBufferData(
ALuint buffer,
ALenum format,
const ALvoid *data,
ALsizei size,
ALsizei freq
);
buffer : buffer name to be filled with data.
format : format type from among the following: AL_FORMAT_MONO8, AL_FORMAT_MONO16, AL_FORMAT_STEREO8, AL_FORMAT_STEREO16.
data : pointer to the audio data.
size : size of the audio data in bytes.
freq. : the frequrnce of the audio data.
alGenSource: generates the number of sources desired.
alSourcei : This function sets an integer property of a source.
void alSourcei(
ALuint source,
ALenum param,
ALint value
);
source : source name whose attribute is being set.
param : the name of the attribute to set: AL_SOURCE_RELATIVE, AL_CONE_INNER_ANGLE,AL_CONE_OUTER_ANGLE,AL_LOOPING,AL_BUFFER,AL_SOURCE_STATE.
value : the value to set the attribute to.
alSourcePlay : plays the buffer using source.
alGetListenerfv, alListener3f, alSourcei, alGetSource3f : these are the methods that allows you to updated Source and listener properties dynamically.
AudioFileReadBytes : Reads bytes of audio data from an audio file.
OSStatus AudioFileReadBytes{
AudioFileID inAudioFile,
Boolean inUseCache,
SInt64 inStartingByte,
UInt32* ioNumBytes,
void* outBuffer
};
inAudioFile : The audio file whose bytes of data you want to read.
inUseCache : decides read or write data caching.
inStartingByte : the byte offset of the audio data you want to be returned.
inNumBytes : on input, a pointer to the number of bytes to read.On output, a pointer to the number of bytes actually read.
outBuffer : a pointer to user-allocated memory large enough for the requested bytes.
AudioFileOpenURL : Open an existing audio file specified by a URL.
OSStatus AudioFileOpenURL(
CFURLRef inFileRef,
SInt8 inPermissions,
AudioFileTypeID inFileTypeHint,
AudioFileID * outAudioFile
);
inFileRef : The URL of an existing audio file.
inPermissions : The read-write permissions you want to assign to the file(kAudioFileReadPermission, kAudioFileWritePermission, kAudioFileReadWritePermission).
inFileTypeHint : Use this to hint to indicated the file type,otherwise, pass 0.
outAudioFile : A pointer to the newly opened audio file.
AudioFileGetProperty:
Gets the value of an audio file property.
OSStatus AudioFileGetProperty(
AudioFileID inAudioFile,
AudioFilePropertyID inPropertyID,
UInt32 *ioDataSize,
void *outPropertyData
);
inAudioFile : The audio file you want to obtain a property value from.
inPropertyID : The property whose value you want.\
ioDataSize : On input, the size of the buffer passed in the outPropertyData parameter. On output, the number of bytes written to the buffer.
outPropertyData : On output, the value of the property specified in the inPropertyID parameter.