I could not find detailed explanation about this function. What I want to know now is that:

Will this function block current thread? Or it just tells the device to start playing audio asynchronously any returns at once?

有帮助吗?

解决方案

Yes, the code which wraps your call to alSourcePlay is blocking so wants to be in its own thread. OpenAL has its own event loop to buffer up and render sound into the audio device(s).

Typically you want a separate thread to make available your source media (thread 1) and another thread for your OpenAL logic (thread 2). This is in addition to your UI thread (thread 3) if any.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top