Pass true to enable the audio thread. Otherwise, it will just live as a dummy mock object that you should not actually try to use.
When the internal refcount reaches zero, it stops the audio and rejoins the thread, throwing any pending exception (yes the dtor can throw! extremely unlikely though).
Keeps an internal refcount.
You should call exit instead of join. It will signal the thread to exit and then call join for you.
This allows you to check if(audio) to see if it is enabled.
Don't call this unless you're sure you know what you're doing.
Returns true if the output is suspended. Use suspend and unsuspend to change this.
provides automatic arsd.jsvar script wrapping capability. Make sure the script also finishes before this goes out of scope or it may end up talking to a dead object....
Other methods are forwarded to the implementation of type AudioPcmOutThreadImplementation. See that for more information on what you can do.
Added May 9, 2020 to replace the old AudioPcmOutThread class that proved pretty difficult to use correctly.
Wraps AudioPcmOutThreadImplementation with RAII semantics for better error handling and disposal than the old way.
DO NOT USE THE new OPERATOR ON THIS! Just construct it inline: