Giter VIP home page Giter VIP logo

Comments (2)

kcat avatar kcat commented on June 30, 2024

If you request a higher number of sources at context creation, you can allocate more:

ALCint attributes[] = {
    ALC_MONO_SOURCES, 1024,
    0 /* end of list */
};
context = alcCreateContext(device, attributes);

You can then query the device with alcGetIntegerv to see how many ALC_MONO_SOURCES and ALC_STEREO_SOURCES are available. (OpenAL Soft treats all sources equally; it doesn't matter how many are set to be "mono" or "stereo", if you have a source you can play a buffer of any available channel configuration with it).

However, it's generally a good idea to use a dynamic source pool, where you have a pool of available sources and take a source when a sound needs to be played, and put it back when it's done playing, rather than assigning a source to an object for the lifetime of the object. Especially given a distance threshold (you don't need to play sounds that are far enough away that you can't hear them) and a priority system (where more important sounds can preempt/stop less important ones and take their source if there are none available), you won't normally need more than a few dozen or maybe a hundred sources playing simultaneously.

from openal-soft.

DebugBSD avatar DebugBSD commented on June 30, 2024

Thank you so much for your support and suggestion. I'll look for dynamic source pool to see how to use it.

from openal-soft.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.