openal

Description

OpenAL is a cross platform audio library designed for use in conjunction with 3D applications.

(oa-start)

Returns void

Starts up the openal audio system

Example

 (oa-start)
 (define mysample (oa-load-sample (fullpath "sample.wav")))
 (oa-play mysample (vector 0 0 0) 1 0.2)

(oa-load-sample)

Returns sampleid-number

Loads a sample and returns the id number, so it can be played.

Example

 (oa-start)
 (define mysample (oa-load-sample "sample.wav"))
 (oa-play mysample (vector 0 0 0) 1 0.2)

(oa-update)

Returns void

Keeps the openal code running, is called by the every-frame code.

Example

 (oa-update)

(oa-play sample-id position pitch gain)

Returns void

Plays a sample.

Example

 (oa-start)
 (define mysample (oa-load-sample (fullpath "sample.wav")))
 (oa-play mysample (vector 0 0 0) 1 0.2)

(oa-set-head-pos pos dir)

Returns void

Sets the head position, or listener position - which changes the panning and perhaps filtering of the sounds to relate to world space position.

Example

 (oa-start)
 (define mysample (oa-load-sample (fullpath "sample.wav")))
 (oa-set-head-pos (vector -1 0 0) (vector 0 0 1))
 (oa-play mysample (vector 0 0 0) 1 0.2)

(oa-set-poly polyphony-count)

Returns void

Sets the number of samples that can be played at once. Defaults to 256.

Example

 (oa-set-poly 256)

(oa-set-cull-dist distance)

Returns void

Sets distance at which sounds will be stopped playing

Example

 (oa-set-cull-dist 1000)

(oa-set-acoustics attenuation-scale max-distance ref-distance rolloff)

Returns void

Sets some global acoustic parameters

Example

 (oa-set-acoustics 1 1 1 1)