Re: How to route the sound to the specific channel e.g. LFE

Chris Robinson <[email protected]>
Newsgroups gmane.comp.lib.openal
Message-ID <[email protected]>
On Tuesday, November 16, 2010 3:42:10 pm Andrzej Artymowicz wrote:
> I'm curious is it possible to route the sound to the specific channel e.g.
> LFE?

Hi.

The most compatible way would be to create a 5.1 buffer (using 
AL_EXT_MCFORMATS), and leave all the channels silent except for the LFE, which 
would be filled with your data:

void BufferLFE(ALuint bid, ALshort *data, ALsizei bytes, ALsizei freq)
{
    std::vector<ALshort> alldata(bytes/sizeof(ALshort)*6);
    for(size_t i = 0;i < alldata.size();i+=6)
    {
        alldata[i  ] = 0; // front-left
        alldata[i+1] = 0; // front-right
        alldata[i+2] = 0; // center
        alldata[i+3] = data[i/6]; // lfe
        alldata[i+4] = 0; // back-left
        alldata[i+5] = 0; // back-right
    }
    alBufferData(bid, AL_FORMAT_51CHN16, &alldata[0], alldata.size() *
                                                      sizeof(ALshort), freq);
}

There is also the ALC_EXT_DEDICATED extension 
<http://icculus.org/alextreg/index.php?operation=op_showext&extname=ALC_EXT_DEDICATED>
although that is only available in the Rapture3D driver, AFAIK.
_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.