[Fluxus] commit: fluxus-openal
Dave Griffiths
dave at pawfal.org
Mon Jun 22 06:02:56 PDT 2009
Hi all,
I've added a new fluxus module for using OpenAL, which is an audio
playback library specifically designed for 3D applications. This isn't
meant as a replacement to fluxa, more as a cross platform alternative
for games. It's easier to use as it doesn't need jack, but it won't do
sample accurate playback, so sequencing music won't really work.
Also, as it bypasses jack, it can't be used in conjunction with fluxa or
commands like gh.
There is an openal.scm example which should work.
Docs:
(oa-start)
Returns void
Starts up the openal audio system
(oa-start)
(define mysample (oa-load-sample (fullpath "sample.wav")))
(oa-play mysample (vector 0 0 0) 1 0.2)
------------------------------------------------------------
(oa-load-sample)
Returns void
Loads a sample and returns the id number, so it can be played.
(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.
(oa-update)
------------------------------------------------------------
(oa-play sample-id position pitch gain)
Returns void
Plays a sample.
(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.
(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.
(oa-set-poly 256)
------------------------------------------------------------
(oa-set-cull-dist distance)
Returns void
Sets distance at which sounds will be stopped playing
(oa-set-cull-dist 1000)
------------------------------------------------------------
(oa-set-acoustics attenuation-scale max-distance ref-distance rolloff)
Returns void
Sets some global acoustic parameters
(oa-set-acoustics 1 1 1 1)
More information about the Fluxus
mailing list