Fork me on GitHub


Queue is a special audio source which can be used to queue other audio sources. Possible uses include making endless mix of music by queueing random music patterns, streaming generated audio by cycling a few Wav objects you rewrite with loadRaw(), concatenative speech synthesis, or just simply chaining a couple sounds for some reason.

The parameters of the played audio sources are ignored. This means that all of the audio sources should have the same parameters: sample rate, channels - and that the queue must be set up to those parameters before playing.

Only one instance of a queue can play at a time.

Queues an audio source for playback.; // Play it, Sam


Returns the number of audio sources remaining in queue.

// If queue is getting short, queue another pattern.
if (gQueue.getQueueCount() < 3)[rand()%8]);


Check if the audio source is currently playing in queue.

if (gQueue.isCurrentlyPlaying(gTheGoodBit))
    print("Yay, the good bit");


Get audio playback parameters from an audio source, instead of specifying them explicitly.



Set audio parameters. Use this or the setParamsFromAudioSource() before using the queue.

// Stereo 44.1kHz, just like the redbook ordered.
gQueue.setParams(44100, 2);

Queue.setLooping(), Queue.setLoopPoint(), Queue.getLoopPoint()

Trying to change the looping state of a queue has no effect.


This is equivalent of calling soloud.stopAudioSource() with the sound source.


As with any other audio source, you can attach filters to queues.

gMusicQueue.setFilter(0, &gConcertHall);


Set the inaudible behavior of the sound. By default, if a sound is inaudible, it's paused, and will resume when it becomes audible again. With this function you can tell SoLoud to either kill the sound if it becomes inaudible, or to keep ticking the sound even if it's inaudible.

// Kill off the sfx if they're not heard.
gFireworkQueue.setInaudibleBehavior(false, true);


Set the default volume of the queue.


Inherited 3d audio interfaces

Like all other audio sources, the queue inherits the 3d audio interfaces. Please refer to the 3d audio chapter for details on:

Copyright©2013-2020 Jari Komppa