Blender V2.61 - r43446
Defines | Typedefs | Functions | Variables

AUD_C-API.cpp File Reference

#include <set>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include "AUD_NULLDevice.h"
#include "AUD_I3DDevice.h"
#include "AUD_I3DHandle.h"
#include "AUD_FileFactory.h"
#include "AUD_FileWriter.h"
#include "AUD_StreamBufferFactory.h"
#include "AUD_DelayFactory.h"
#include "AUD_LimiterFactory.h"
#include "AUD_PingPongFactory.h"
#include "AUD_LoopFactory.h"
#include "AUD_RectifyFactory.h"
#include "AUD_EnvelopeFactory.h"
#include "AUD_LinearResampleFactory.h"
#include "AUD_LowpassFactory.h"
#include "AUD_HighpassFactory.h"
#include "AUD_AccumulatorFactory.h"
#include "AUD_SumFactory.h"
#include "AUD_SquareFactory.h"
#include "AUD_ChannelMapperFactory.h"
#include "AUD_Buffer.h"
#include "AUD_ReadDevice.h"
#include "AUD_IReader.h"
#include "AUD_SequencerFactory.h"
#include "AUD_SequencerEntry.h"
#include "AUD_SilenceFactory.h"
#include <cassert>
#include "AUD_C-API.h"

Go to the source code of this file.

Defines

#define __STDC_CONSTANT_MACROS
#define AUD_CAPI_IMPLEMENTATION
#define NULL   0

Typedefs

typedef AUD_Reference
< AUD_IFactory
AUD_Sound
typedef AUD_Reference
< AUD_ReadDevice
AUD_Device
typedef AUD_Reference
< AUD_IHandle
AUD_Handle
typedef AUD_Reference
< AUD_SequencerEntry
AUD_SEntry

Functions

void AUD_initOnce ()
int AUD_init (AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize)
void AUD_exit ()
void AUD_lock ()
void AUD_unlock ()
AUD_SoundInfo AUD_getInfo (AUD_Sound *sound)
AUD_SoundAUD_load (const char *filename)
AUD_SoundAUD_loadBuffer (unsigned char *buffer, int size)
AUD_SoundAUD_bufferSound (AUD_Sound *sound)
AUD_SoundAUD_monoSound (AUD_Sound *sound)
AUD_SoundAUD_delaySound (AUD_Sound *sound, float delay)
AUD_SoundAUD_limitSound (AUD_Sound *sound, float start, float end)
AUD_SoundAUD_pingpongSound (AUD_Sound *sound)
AUD_SoundAUD_loopSound (AUD_Sound *sound)
int AUD_setLoop (AUD_Handle *handle, int loops)
AUD_SoundAUD_rectifySound (AUD_Sound *sound)
void AUD_unload (AUD_Sound *sound)
AUD_HandleAUD_play (AUD_Sound *sound, int keep)
int AUD_pause (AUD_Handle *handle)
int AUD_resume (AUD_Handle *handle)
int AUD_stop (AUD_Handle *handle)
int AUD_setKeep (AUD_Handle *handle, int keep)
int AUD_seek (AUD_Handle *handle, float seekTo)
float AUD_getPosition (AUD_Handle *handle)
AUD_Status AUD_getStatus (AUD_Handle *handle)
int AUD_setListenerLocation (const float *location)
int AUD_setListenerVelocity (const float *velocity)
int AUD_setListenerOrientation (const float *orientation)
int AUD_setSpeedOfSound (float speed)
int AUD_setDopplerFactor (float factor)
int AUD_setDistanceModel (AUD_DistanceModel model)
int AUD_setSourceLocation (AUD_Handle *handle, const float *location)
int AUD_setSourceVelocity (AUD_Handle *handle, const float *velocity)
int AUD_setSourceOrientation (AUD_Handle *handle, const float *orientation)
int AUD_setRelative (AUD_Handle *handle, int relative)
int AUD_setVolumeMaximum (AUD_Handle *handle, float volume)
int AUD_setVolumeMinimum (AUD_Handle *handle, float volume)
int AUD_setDistanceMaximum (AUD_Handle *handle, float distance)
int AUD_setDistanceReference (AUD_Handle *handle, float distance)
int AUD_setAttenuation (AUD_Handle *handle, float factor)
int AUD_setConeAngleOuter (AUD_Handle *handle, float angle)
int AUD_setConeAngleInner (AUD_Handle *handle, float angle)
int AUD_setConeVolumeOuter (AUD_Handle *handle, float volume)
int AUD_setSoundVolume (AUD_Handle *handle, float volume)
int AUD_setSoundPitch (AUD_Handle *handle, float pitch)
AUD_DeviceAUD_openReadDevice (AUD_DeviceSpecs specs)
AUD_HandleAUD_playDevice (AUD_Device *device, AUD_Sound *sound, float seek)
int AUD_setDeviceVolume (AUD_Device *device, float volume)
int AUD_readDevice (AUD_Device *device, data_t *buffer, int length)
void AUD_closeReadDevice (AUD_Device *device)
float * AUD_readSoundBuffer (const char *filename, float low, float high, float attack, float release, float threshold, int accumulate, int additive, int square, float sthreshold, double samplerate, int *length)
static void pauseSound (AUD_Handle *handle)
AUD_HandleAUD_pauseAfter (AUD_Handle *handle, float seconds)
AUD_SoundAUD_createSequencer (float fps, int muted)
void AUD_destroySequencer (AUD_Sound *sequencer)
void AUD_setSequencerMuted (AUD_Sound *sequencer, int muted)
void AUD_setSequencerFPS (AUD_Sound *sequencer, float fps)
AUD_SEntryAUD_addSequence (AUD_Sound *sequencer, AUD_Sound *sound, float begin, float end, float skip)
void AUD_removeSequence (AUD_Sound *sequencer, AUD_SEntry *entry)
void AUD_moveSequence (AUD_SEntry *entry, float begin, float end, float skip)
void AUD_muteSequence (AUD_SEntry *entry, char mute)
void AUD_setRelativeSequence (AUD_SEntry *entry, char relative)
void AUD_updateSequenceSound (AUD_SEntry *entry, AUD_Sound *sound)
void AUD_setSequenceAnimData (AUD_SEntry *entry, AUD_AnimateablePropertyType type, int frame, float *data, char animated)
void AUD_setSequencerAnimData (AUD_Sound *sequencer, AUD_AnimateablePropertyType type, int frame, float *data, char animated)
void AUD_updateSequenceData (AUD_SEntry *entry, float volume_max, float volume_min, float distance_max, float distance_reference, float attenuation, float cone_angle_outer, float cone_angle_inner, float cone_volume_outer)
void AUD_updateSequencerData (AUD_Sound *sequencer, float speed_of_sound, float factor, AUD_DistanceModel model)
void AUD_setSequencerDeviceSpecs (AUD_Sound *sequencer)
void AUD_setSequencerSpecs (AUD_Sound *sequencer, AUD_Specs specs)
void AUD_seekSequencer (AUD_Handle *handle, float time)
float AUD_getSequencerPosition (AUD_Handle *handle)
void AUD_startPlayback ()
void AUD_stopPlayback ()
int AUD_doesPlayback ()
int AUD_readSound (AUD_Sound *sound, sample_t *buffer, int length, int samples_per_second)
AUD_SoundAUD_copy (AUD_Sound *sound)
void AUD_freeHandle (AUD_Handle *handle)
void * AUD_createSet ()
void AUD_destroySet (void *set)
char AUD_removeSet (void *set, void *entry)
void AUD_addSet (void *set, void *entry)
void * AUD_getSet (void *set)
const char * AUD_mixdown (AUD_Sound *sound, unsigned int start, unsigned int length, unsigned int buffersize, const char *filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate)
AUD_DeviceAUD_openMixdownDevice (AUD_DeviceSpecs specs, AUD_Sound *sequencer, float volume, float start)
AUD_Reference< AUD_IDeviceAUD_getDevice ()
AUD_I3DDeviceAUD_get3DDevice ()

Variables

static AUD_Reference< AUD_IDeviceAUD_device
static AUD_I3DDeviceAUD_3ddevice

Detailed Description

Definition in file AUD_C-API.cpp.


Define Documentation

#define __STDC_CONSTANT_MACROS

Definition at line 32 of file AUD_C-API.cpp.

#define AUD_CAPI_IMPLEMENTATION

Definition at line 97 of file AUD_C-API.cpp.

#define NULL   0

Typedef Documentation

Definition at line 93 of file AUD_C-API.cpp.

Definition at line 94 of file AUD_C-API.cpp.

Definition at line 95 of file AUD_C-API.cpp.

Definition at line 92 of file AUD_C-API.cpp.


Function Documentation

AUD_SEntry* AUD_addSequence ( AUD_Sound sequencer,
AUD_Sound sound,
float  begin,
float  end,
float  skip 
)

Adds a new entry to the scene.

Parameters:
sequencerThe sound scene.
soundThe sound this entry should play.
beginThe start time.
endThe end time or a negative value if determined by the sound.
skipHow much seconds should be skipped at the beginning.
Returns:
The entry added.

Definition at line 949 of file AUD_C-API.cpp.

References add(), and AUD_Reference< T >::get().

void AUD_addSet ( void *  set,
void *  entry 
)

Adds a new entry to a set.

Parameters:
setThe set work on.
entryThe entry to add.

Definition at line 1196 of file AUD_C-API.cpp.

AUD_Sound* AUD_bufferSound ( AUD_Sound sound)

Buffers a sound.

Parameters:
soundThe sound to buffer.
Returns:
A handle of the sound buffer.

Definition at line 321 of file AUD_C-API.cpp.

References assert, and NULL.

void AUD_closeReadDevice ( AUD_Device device)

Closes a read device.

Parameters:
deviceThe read device.

Definition at line 814 of file AUD_C-API.cpp.

References assert.

AUD_Sound* AUD_copy ( AUD_Sound sound)

Copies a sound.

Parameters:
soundSound to copy.
Returns:
Copied sound.

Definition at line 1169 of file AUD_C-API.cpp.

AUD_Sound* AUD_createSequencer ( float  fps,
int  muted 
)

Creates a new sequenced sound scene.

Parameters:
fpsThe FPS of the scene.
mutedWhether the scene is muted.
Returns:
The new sound scene.

Definition at line 924 of file AUD_C-API.cpp.

References AUD_CHANNELS_STEREO, AUD_RATE_44100, AUD_Specs::channels, and AUD_Specs::rate.

void* AUD_createSet ( void  )

Creates a new set.

Returns:
The new set.

Definition at line 1179 of file AUD_C-API.cpp.

AUD_Sound* AUD_delaySound ( AUD_Sound sound,
float  delay 
)

Delays a sound.

Parameters:
soundThe sound to dealy.
delayThe delay in seconds.
Returns:
A handle of the delayed sound.

Definition at line 353 of file AUD_C-API.cpp.

References assert, and NULL.

void AUD_destroySequencer ( AUD_Sound sequencer)

Deletes a sound scene.

Parameters:
sequencerThe sound scene.

Definition at line 934 of file AUD_C-API.cpp.

void AUD_destroySet ( void *  set)

Deletes a set.

Parameters:
setThe set to delete.

Definition at line 1184 of file AUD_C-API.cpp.

int AUD_doesPlayback ( void  )

Returns whether jack transport is currently playing.

Returns:
Whether jack transport is currently playing.

Definition at line 1092 of file AUD_C-API.cpp.

References AUD_JackDevice::doesPlayback(), and AUD_Reference< T >::get().

void AUD_exit ( void  )

Unitinitializes an audio device.

Definition at line 171 of file AUD_C-API.cpp.

References NULL.

Referenced by AUD_init().

void AUD_freeHandle ( AUD_Handle channel)

Frees a handle.

Parameters:
channelHandle to free.

Definition at line 1174 of file AUD_C-API.cpp.

AUD_I3DDevice* AUD_get3DDevice ( )

Definition at line 1266 of file AUD_C-API.cpp.

References AUD_3ddevice.

Referenced by StartKetsjiShell().

AUD_Reference<AUD_IDevice> AUD_getDevice ( )

Definition at line 1261 of file AUD_C-API.cpp.

References AUD_device.

Referenced by StartKetsjiShell().

AUD_SoundInfo AUD_getInfo ( AUD_Sound sound)

Returns information about a sound.

Parameters:
soundThe sound to get the info about.
Returns:
The AUD_SoundInfo structure with filled in data.

Definition at line 283 of file AUD_C-API.cpp.

References assert, AUD_CHANNELS_INVALID, AUD_RATE_INVALID, AUD_Specs::channels, AUD_Reference< T >::isNull(), AUD_SoundInfo::length, AUD_Specs::rate, and AUD_SoundInfo::specs.

Referenced by add_nla_soundstrip(), and reload_sequence_new_file().

float AUD_getPosition ( AUD_Handle handle)

Retrieves the playback position of a handle.

Parameters:
handleThe handle to the sound.
Returns:
The current playback position in seconds or 0.0 if the handle is invalid.

Definition at line 491 of file AUD_C-API.cpp.

References assert.

float AUD_getSequencerPosition ( AUD_Handle handle)

Returns the current sound scene playback time.

Parameters:
handlePlayback handle.
Returns:
The playback time in seconds.

Definition at line 1051 of file AUD_C-API.cpp.

References assert, AUD_Reference< T >::get(), and AUD_JackDevice::getPlaybackPosition().

void* AUD_getSet ( void *  set)

Removes one entry from a set and returns it.

Parameters:
setThe set work on.
Returns:
The entry or NULL if the set is empty.

Definition at line 1202 of file AUD_C-API.cpp.

References NULL.

AUD_Status AUD_getStatus ( AUD_Handle handle)

Returns the status of a playing, paused or stopped sound.

Parameters:
handleThe handle to the sound.
Returns:
The status of the sound behind the handle.

Definition at line 497 of file AUD_C-API.cpp.

References assert.

int AUD_init ( AUD_DeviceType  device,
AUD_DeviceSpecs  specs,
int  buffersize 
)

Initializes an audio device.

Parameters:
deviceThe device type that should be used.
specsThe audio specification to be used.
buffersizeThe buffersize for the device.
Returns:
Whether the device has been initialized.

Definition at line 114 of file AUD_C-API.cpp.

References AUD_exit(), AUD_JACK_DEVICE, AUD_NULL_DEVICE, AUD_OPENAL_DEVICE, AUD_SDL_DEVICE, AUD_Reference< T >::get(), and AUD_Reference< T >::isNull().

void AUD_initOnce ( void  )

Initializes FFMPEG if it is enabled.

Definition at line 107 of file AUD_C-API.cpp.

AUD_Sound* AUD_limitSound ( AUD_Sound sound,
float  start,
float  end 
)

Limits a sound.

Parameters:
soundThe sound to limit.
startThe start time in seconds.
endThe stop time in seconds.
Returns:
A handle of the limited sound.

Definition at line 367 of file AUD_C-API.cpp.

References assert, and NULL.

AUD_Sound* AUD_load ( const char *  filename)

Loads a sound file.

Parameters:
filenameThe filename of the sound file.
Returns:
A handle of the sound file.

Definition at line 309 of file AUD_C-API.cpp.

References assert.

AUD_Sound* AUD_loadBuffer ( unsigned char *  buffer,
int  size 
)

Loads a sound file.

Parameters:
bufferThe buffer which contains the sound file.
sizeThe size of the buffer.
Returns:
A handle of the sound file.

Definition at line 315 of file AUD_C-API.cpp.

References assert.

void AUD_lock ( void  )

Locks the playback device.

Definition at line 273 of file AUD_C-API.cpp.

AUD_Sound* AUD_loopSound ( AUD_Sound sound)

Loops a sound.

Parameters:
soundThe sound to loop.
Returns:
A handle of the looped sound.

Definition at line 395 of file AUD_C-API.cpp.

References assert, and NULL.

const char* AUD_mixdown ( AUD_Sound sound,
unsigned int  start,
unsigned int  length,
unsigned int  buffersize,
const char *  filename,
AUD_DeviceSpecs  specs,
AUD_Container  format,
AUD_Codec  codec,
unsigned int  bitrate 
)

Mixes a sound down into a file.

Parameters:
soundThe sound scene to mix down.
startThe start frame.
lengthThe count of frames to write.
buffersizeHow many samples should be written at once.
filenameThe file to write to.
specsThe file's audio specification.
formatThe file's container format.
codecThe codec used for encoding the audio data.
bitrateThe bitrate for encoding.
Returns:
An error message or NULL in case of success.

Definition at line 1219 of file AUD_C-API.cpp.

References AUD_SequencerFactory::createQualityReader(), AUD_FileWriter::createWriter(), credits_svn_gen::e, AUD_Reference< T >::get(), NULL, AUD_SequencerFactory::setSpecs(), AUD_DeviceSpecs::specs, AUD_Exception::str, and AUD_FileWriter::writeReader().

Referenced by sound_mixdown_exec().

AUD_Sound* AUD_monoSound ( AUD_Sound sound)

Rechannels the sound to be mono.

Parameters:
soundThe sound to rechannel.
Returns:
The mono sound.

Definition at line 335 of file AUD_C-API.cpp.

References assert, AUD_CHANNELS_MONO, AUD_FORMAT_INVALID, AUD_RATE_INVALID, AUD_DeviceSpecs::channels, AUD_DeviceSpecs::format, NULL, and AUD_DeviceSpecs::rate.

void AUD_moveSequence ( AUD_SEntry entry,
float  begin,
float  end,
float  skip 
)

Moves the entry.

Parameters:
entryThe sequenced entry.
beginThe new start time.
endThe new end time or a negative value if unknown.
skipHow many seconds to skip at the beginning.

Definition at line 963 of file AUD_C-API.cpp.

void AUD_muteSequence ( AUD_SEntry entry,
char  mute 
)

Sets the muting state of the entry.

Parameters:
entryThe sequenced entry.
muteWhether the entry should be muted or not.

Definition at line 968 of file AUD_C-API.cpp.

AUD_Device* AUD_openMixdownDevice ( AUD_DeviceSpecs  specs,
AUD_Sound sequencer,
float  volume,
float  start 
)

Opens a read device and prepares it for mixdown of the sound scene.

Parameters:
specsOutput audio specifications.
sequencerThe sound scene to mix down.
volumeThe overall mixdown volume.
startThe start time of the mixdown in the sound scene.
Returns:
The read device for the mixdown.

Definition at line 1239 of file AUD_C-API.cpp.

References AUD_Reference< T >::get(), AUD_Reference< T >::isNull(), NULL, AUD_SoftwareDevice::play(), AUD_SoftwareDevice::setQuality(), AUD_SoftwareDevice::setVolume(), and AUD_DeviceSpecs::specs.

AUD_Device* AUD_openReadDevice ( AUD_DeviceSpecs  specs)

Opens a read device, with which audio data can be read.

Parameters:
specsThe specification of the audio data.
Returns:
A device handle.

Definition at line 753 of file AUD_C-API.cpp.

References NULL.

int AUD_pause ( AUD_Handle handle)

Pauses a played back sound.

Parameters:
handleThe handle to the sound.
Returns:
Whether the handle has been playing or not.

Definition at line 459 of file AUD_C-API.cpp.

References assert.

AUD_Handle* AUD_pauseAfter ( AUD_Handle handle,
float  seconds 
)

Pauses a playing sound after a specific amount of time.

Parameters:
handleThe handle to the sound.
secondsThe time in seconds.
Returns:
The silence handle.

Definition at line 898 of file AUD_C-API.cpp.

References AUD_Reference< T >::isNull(), NULL, and pauseSound().

AUD_Sound* AUD_pingpongSound ( AUD_Sound sound)

Ping pongs a sound.

Parameters:
soundThe sound to ping pong.
Returns:
A handle of the ping pong sound.

Definition at line 381 of file AUD_C-API.cpp.

References assert, and NULL.

AUD_Handle* AUD_play ( AUD_Sound sound,
int  keep 
)

Plays back a sound file.

Parameters:
soundThe handle of the sound file.
keepWhen keep is true the sound source will not be deleted but set to paused when its end has been reached.
Returns:
A handle to the played back sound.

Definition at line 444 of file AUD_C-API.cpp.

References assert, AUD_Reference< T >::isNull(), and NULL.

AUD_Handle* AUD_playDevice ( AUD_Device device,
AUD_Sound sound,
float  seek 
)

Plays back a sound file through a read device.

Parameters:
deviceThe read device.
soundThe handle of the sound file.
seekThe position where the sound should be seeked to.
Returns:
A handle to the played back sound.

Definition at line 765 of file AUD_C-API.cpp.

References assert, AUD_Reference< T >::isNull(), and NULL.

int AUD_readDevice ( AUD_Device device,
data_t buffer,
int  length 
)

Reads the next samples into the supplied buffer.

Parameters:
deviceThe read device.
bufferThe target buffer.
lengthThe length in samples to be filled.
Returns:
True if the reading succeeded, false if there are no sounds played back currently, in that case the buffer is filled with silence.

Definition at line 799 of file AUD_C-API.cpp.

References assert.

int AUD_readSound ( AUD_Sound sound,
sample_t buffer,
int  length,
int  samples_per_second 
)

Reads a sound into a buffer for drawing at a specific sampling rate.

Parameters:
soundThe sound to read.
bufferThe buffer to write to. Must have a size of 3*4*length.
lengthHow many samples to read from the sound.
samples_per_secondHow many samples to read per second of the sound.
Returns:
How many samples really have been read. Always <= length.

Definition at line 1102 of file AUD_C-API.cpp.

References AUD_Buffer::assureSize(), AUD_CHANNELS_MONO, AUD_FORMAT_INVALID, AUD_RATE_INVALID, AUD_SAMPLE_SIZE, AUD_DeviceSpecs::channels, AUD_ChannelMapperFactory::createReader(), AUD_DeviceSpecs::format, AUD_Buffer::getBuffer(), i, len(), length(), max, min, AUD_DeviceSpecs::rate, AUD_DeviceSpecs::specs, and sqrt().

float* AUD_readSoundBuffer ( const char *  filename,
float  low,
float  high,
float  attack,
float  release,
float  threshold,
int  accumulate,
int  additive,
int  square,
float  sthreshold,
double  samplerate,
int *  length 
)

Reads a sound file into a newly created float buffer. The sound is therefore bandpassed, rectified and resampled.

Definition at line 827 of file AUD_C-API.cpp.

References AUD_CHANNELS_MONO, AUD_DeviceSpecs::channels, AUD_Buffer::getBuffer(), AUD_Reference< T >::isNull(), len(), NULL, AUD_DeviceSpecs::rate, and AUD_Buffer::resize().

AUD_Sound* AUD_rectifySound ( AUD_Sound sound)

Rectifies a sound.

Parameters:
soundThe sound to rectify.
Returns:
A handle of the rectified sound.

Definition at line 424 of file AUD_C-API.cpp.

References assert, and NULL.

void AUD_removeSequence ( AUD_Sound sequencer,
AUD_SEntry entry 
)

Removes an entry from the scene.

Parameters:
sequencerThe sound scene.
entryThe entry to remove.

Definition at line 957 of file AUD_C-API.cpp.

References AUD_Reference< T >::get().

char AUD_removeSet ( void *  set,
void *  entry 
)

Removes an entry from a set.

Parameters:
setThe set work on.
entryThe entry to remove.
Returns:
Whether the entry was in the set or not.

Definition at line 1189 of file AUD_C-API.cpp.

int AUD_resume ( AUD_Handle handle)

Resumes a paused sound.

Parameters:
handleThe handle to the sound.
Returns:
Whether the handle has been paused or not.

Definition at line 465 of file AUD_C-API.cpp.

References assert.

int AUD_seek ( AUD_Handle handle,
float  seekTo 
)

Seeks a playing or paused sound.

Parameters:
handleThe handle to the sound.
seekToFrom where the sound file should be played back in seconds.
Returns:
Whether the handle has been valid or not.

Definition at line 485 of file AUD_C-API.cpp.

References assert.

void AUD_seekSequencer ( AUD_Handle handle,
float  time 
)

Seeks sequenced sound scene playback.

Parameters:
handlePlayback handle.
timeTime in seconds to seek to.

Definition at line 1037 of file AUD_C-API.cpp.

References assert, AUD_Reference< T >::get(), and AUD_JackDevice::seekPlayback().

int AUD_setAttenuation ( AUD_Handle handle,
float  factor 
)

Sets the attenuation of a source. This value is used for distance calculation.

Parameters:
handleThe handle of the source.
factorThe new attenuation.
Returns:
Whether the action succeeded.

Definition at line 679 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

int AUD_setConeAngleInner ( AUD_Handle handle,
float  angle 
)

Sets the inner angle of the cone of a source.

Parameters:
handleThe handle of the source.
angleThe new inner angle of the cone.
Returns:
Whether the action succeeded.

Definition at line 705 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

int AUD_setConeAngleOuter ( AUD_Handle handle,
float  angle 
)

Sets the outer angle of the cone of a source.

Parameters:
handleThe handle of the source.
angleThe new outer angle of the cone.
Returns:
Whether the action succeeded.

Definition at line 692 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

int AUD_setConeVolumeOuter ( AUD_Handle handle,
float  volume 
)

Sets the outer volume of the cone of a source. The volume between inner and outer angle is interpolated between inner volume and this value.

Parameters:
handleThe handle of the source.
volumeThe new outer volume of the cone.
Returns:
Whether the action succeeded.

Definition at line 718 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

int AUD_setDeviceVolume ( AUD_Device device,
float  volume 
)

Sets the main volume of a device.

Parameters:
deviceThe device.
volumeThe new volume, must be between 0.0 and 1.0.
Returns:
Whether the action succeeded.

Definition at line 785 of file AUD_C-API.cpp.

References assert.

int AUD_setDistanceMaximum ( AUD_Handle handle,
float  distance 
)

Sets the maximum distance of a source. If a source is further away from the reader than this distance, the volume will automatically be set to 0.

Parameters:
handleThe handle of the source.
distanceThe new maximum distance.
Returns:
Whether the action succeeded.

Definition at line 653 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

int AUD_setDistanceModel ( AUD_DistanceModel  model)

Sets the distance model.

Parameters:
modeldistance model.

Definition at line 561 of file AUD_C-API.cpp.

References AUD_I3DDevice::setDistanceModel().

int AUD_setDistanceReference ( AUD_Handle handle,
float  distance 
)

Sets the reference distance of a source.

Parameters:
handleThe handle of the source.
distanceThe new reference distance.
Returns:
Whether the action succeeded.

Definition at line 666 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

int AUD_setDopplerFactor ( float  factor)

Sets the doppler factor. This value is a scaling factor for the velocity vectors of sources and listener which is used while calculating the doppler effect.

Parameters:
factorThe new doppler factor.

Definition at line 550 of file AUD_C-API.cpp.

References AUD_I3DDevice::setDopplerFactor().

int AUD_setKeep ( AUD_Handle handle,
int  keep 
)

Sets the end behaviour of a playing or paused sound.

Parameters:
handleThe handle to the sound.
keepWhen keep is true the sound source will not be deleted but set to paused when its end has been reached.
Returns:
Whether the handle has been valid or not.

Definition at line 479 of file AUD_C-API.cpp.

References assert.

int AUD_setListenerLocation ( const float *  location)

Sets the listener location.

Parameters:
locationThe new location.

Definition at line 503 of file AUD_C-API.cpp.

References AUD_I3DDevice::setListenerLocation().

int AUD_setListenerOrientation ( const float *  orientation)

Sets the listener orientation.

Parameters:
orientationThe new orientation as quaternion.

Definition at line 527 of file AUD_C-API.cpp.

References AUD_I3DDevice::setListenerOrientation().

int AUD_setListenerVelocity ( const float *  velocity)

Sets the listener velocity.

Parameters:
velocityThe new velocity.

Definition at line 515 of file AUD_C-API.cpp.

References AUD_I3DDevice::setListenerVelocity().

int AUD_setLoop ( AUD_Handle handle,
int  loops 
)

Sets a remaining loop count of a looping sound that currently plays.

Parameters:
handleThe playback handle.
loopsThe count of remaining loops, -1 for infinity.
Returns:
Whether the handle is valid.

Definition at line 409 of file AUD_C-API.cpp.

References assert.

int AUD_setRelative ( AUD_Handle handle,
int  relative 
)

Sets whether the source location, velocity and orientation are relative to the listener.

Parameters:
handleThe handle of the source.
relativeWhether the source is relative.
Returns:
Whether the action succeeded.

Definition at line 614 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

void AUD_setRelativeSequence ( AUD_SEntry entry,
char  relative 
)

Sets whether the entrie's location, velocity and orientation are relative to the listener.

Parameters:
entryThe sequenced entry.
relativeWhether the source is relative.
Returns:
Whether the action succeeded.

Definition at line 973 of file AUD_C-API.cpp.

void AUD_setSequenceAnimData ( AUD_SEntry entry,
AUD_AnimateablePropertyType  type,
int  frame,
float *  data,
char  animated 
)

Writes animation data to a sequenced entry.

Parameters:
entryThe sequenced entry.
typeThe type of animation data.
frameThe frame this data is for.
dataThe data to write.
animatedWhether the attribute is animated.

Definition at line 986 of file AUD_C-API.cpp.

References AUD_AnimateableProperty::write().

void AUD_setSequencerAnimData ( AUD_Sound sequencer,
AUD_AnimateablePropertyType  type,
int  frame,
float *  data,
char  animated 
)

Writes animation data to a sequenced entry.

Parameters:
sequencerThe sound scene.
typeThe type of animation data.
frameThe frame this data is for.
dataThe data to write.
animatedWhether the attribute is animated.

Definition at line 998 of file AUD_C-API.cpp.

References AUD_Reference< T >::get(), and AUD_AnimateableProperty::write().

void AUD_setSequencerDeviceSpecs ( AUD_Sound sequencer)

Sets the audio output specification of the sound scene to the specs of the current playback device.

Parameters:
sequencerThe sound scene.

Definition at line 1027 of file AUD_C-API.cpp.

References AUD_Reference< T >::get().

void AUD_setSequencerFPS ( AUD_Sound sequencer,
float  fps 
)

Sets the scene's FPS.

Parameters:
sequencerThe sound scene.
fpsThe new FPS.

Definition at line 944 of file AUD_C-API.cpp.

References AUD_Reference< T >::get().

void AUD_setSequencerMuted ( AUD_Sound sequencer,
int  muted 
)

Sets the muting state of the scene.

Parameters:
sequencerThe sound scene.
mutedWhether the scene is muted.

Definition at line 939 of file AUD_C-API.cpp.

References AUD_Reference< T >::get().

void AUD_setSequencerSpecs ( AUD_Sound sequencer,
AUD_Specs  specs 
)

Sets the audio output specification of the sound scene.

Parameters:
sequencerThe sound scene.
specsThe new specification.

Definition at line 1032 of file AUD_C-API.cpp.

References AUD_Reference< T >::get().

int AUD_setSoundPitch ( AUD_Handle handle,
float  pitch 
)

Sets the pitch of a played back sound.

Parameters:
handleThe handle to the sound.
pitchThe new pitch.
Returns:
Whether the action succeeded.

Definition at line 742 of file AUD_C-API.cpp.

References assert.

int AUD_setSoundVolume ( AUD_Handle handle,
float  volume 
)

Sets the volume of a played back sound.

Parameters:
handleThe handle to the sound.
volumeThe new volume, must be between 0.0 and 1.0.
Returns:
Whether the action succeeded.

Definition at line 731 of file AUD_C-API.cpp.

References assert.

int AUD_setSourceLocation ( AUD_Handle handle,
const float *  location 
)

Sets the location of a source.

Parameters:
handleThe handle of the source.
locationThe new location.
Returns:
Whether the action succeeded.

Definition at line 572 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

int AUD_setSourceOrientation ( AUD_Handle handle,
const float *  orientation 
)

Sets the orientation of a source.

Parameters:
handleThe handle of the source.
orientationThe new orientation as quaternion.
Returns:
Whether the action succeeded.

Definition at line 600 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

int AUD_setSourceVelocity ( AUD_Handle handle,
const float *  velocity 
)

Sets the velocity of a source.

Parameters:
handleThe handle of the source.
velocityThe new velocity.
Returns:
Whether the action succeeded.

Definition at line 586 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

int AUD_setSpeedOfSound ( float  speed)

Sets the speed of sound. This value is needed for doppler effect calculation.

Parameters:
speedThe new speed of sound.

Definition at line 539 of file AUD_C-API.cpp.

References AUD_I3DDevice::setSpeedOfSound().

int AUD_setVolumeMaximum ( AUD_Handle handle,
float  volume 
)

Sets the maximum volume of a source.

Parameters:
handleThe handle of the source.
volumeThe new maximum volume.
Returns:
Whether the action succeeded.

Definition at line 627 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

int AUD_setVolumeMinimum ( AUD_Handle handle,
float  volume 
)

Sets the minimum volume of a source.

Parameters:
handleThe handle of the source.
volumeThe new minimum volume.
Returns:
Whether the action succeeded.

Definition at line 640 of file AUD_C-API.cpp.

References assert, and AUD_Reference< T >::isNull().

void AUD_startPlayback ( void  )

Starts the playback of jack transport if possible.

Definition at line 1065 of file AUD_C-API.cpp.

References AUD_Reference< T >::get(), and AUD_JackDevice::startPlayback().

int AUD_stop ( AUD_Handle handle)

Stops a playing or paused sound.

Parameters:
handleThe handle to the sound.
Returns:
Whether the handle has been valid or not.

Definition at line 471 of file AUD_C-API.cpp.

References assert.

void AUD_stopPlayback ( void  )

Stops the playback of jack transport if possible.

Definition at line 1074 of file AUD_C-API.cpp.

References AUD_Reference< T >::get(), and AUD_JackDevice::stopPlayback().

void AUD_unload ( AUD_Sound sound)

Unloads a sound of any type.

Parameters:
soundThe handle of the sound.

Definition at line 438 of file AUD_C-API.cpp.

References assert.

Referenced by sound_free().

void AUD_unlock ( void  )

Unlocks the device.

Definition at line 278 of file AUD_C-API.cpp.

void AUD_updateSequenceData ( AUD_SEntry entry,
float  volume_max,
float  volume_min,
float  distance_max,
float  distance_reference,
float  attenuation,
float  cone_angle_outer,
float  cone_angle_inner,
float  cone_volume_outer 
)

Updates all non-animated parameters of the entry.

Parameters:
entryThe sequenced entry.
volume_maxThe maximum volume.
volume_minThe minimum volume.
distance_maxThe maximum distance.
distance_referenceThe reference distance.
attenuationThe attenuation.
cone_angle_outerThe outer cone opening angle.
cone_angle_innerThe inner cone opening angle.
cone_volume_outerThe volume outside the outer cone.

Definition at line 1010 of file AUD_C-API.cpp.

void AUD_updateSequencerData ( AUD_Sound sequencer,
float  speed_of_sound,
float  factor,
AUD_DistanceModel  model 
)

Updates all non-animated parameters of the entry.

Parameters:
sequencerThe sound scene.
speed_of_soundThe speed of sound for doppler calculation.
factorThe doppler factor to control the effect's strength.
modelThe distance model for distance calculation.

Definition at line 1018 of file AUD_C-API.cpp.

References AUD_Reference< T >::get(), AUD_SequencerFactory::setDistanceModel(), AUD_SequencerFactory::setDopplerFactor(), and AUD_SequencerFactory::setSpeedOfSound().

void AUD_updateSequenceSound ( AUD_SEntry entry,
AUD_Sound sound 
)

Sets the sound of the entry.

Parameters:
entryThe sequenced entry.
soundThe new sound.

Definition at line 978 of file AUD_C-API.cpp.

static void pauseSound ( AUD_Handle handle) [static]

Definition at line 892 of file AUD_C-API.cpp.

References assert.

Referenced by AUD_pauseAfter(), and KX_SoundActuator::Update().


Variable Documentation

Definition at line 105 of file AUD_C-API.cpp.

Referenced by AUD_get3DDevice().

Definition at line 104 of file AUD_C-API.cpp.

Referenced by AUD_getDevice().