[Openal] Multiple Mono Listeners/Context on same Device
chris.kcat at gmail.com
Tue Sep 7 17:58:58 PDT 2010
On Tuesday, September 07, 2010 4:17:58 pm simon at mungewell.org wrote:
> > I would like to have a 'split screen' arrangement in a racing game with
> > the sounds that each player would hear being directed (in mono) to either
> > the L or R channel of a device.
> In the extension database there is mention of two 'effects':
> but I can't find any code on them.... are they still supported?
They're probably only supported in the Rapture3D driver.
> Is it possible to load a 'fake' device/listener and have that output into
> source buffer to be used by a real device/listener?
Probably not. ALC_EXT_DEDICATED only defines two effects, which just lets you
route a sound to the LFE or front-center speakers. AL_EXT_FOLDBACK might be
useful if there was a device that didn't output to anything, but I don't know
if the driver supports something like that. It would also add some lag since
it would have to 'play' first before you could get the audio data, then you'd
stick it on the end of a buffer queue that would take some time to play
Probably the best you could do would be to create a context for each player,
and instead of doing 3D positioning, set the source to be source-relative and
set its X position to the distance between the sound and the listener (-x for
player 1, +x for player 2). Y and Z should be left at 0, and abs(x) shouldn't
go below AL_REFERENCE_DISTANCE. Also, don't use velocity or directional cones,
unless you can transform them to work given the source's odd relative
More information about the Openal