Setting stream mixers
Restful Cargo

Hi guys. Looking for some clarification on mixing audio streams. Suppose I create an audio chain similar to what was suggested on the allegro docs:

                            / <---- SFX Mixer
Voice <-- Master Mixer <----
                            \ <---- Stream Mixer (Background Music)

So one mixer for sound effects and another for background music so to have discrete control over volume.

For sound effects if I call al_attach_sample_instance_to_mixer() I can tell allegro which mixer to use right there on the function. For example:

/* pseudocode */

al_attach_sample_instance_to_mixer(some_SFX_vector.ptr_instance, mixer_sfx);

///////////

How would I go about this for a stream? Would I have to call al_set_default_mixer() before loading a stream compatible file? E.g.

/* pseudocode */

al_set_default_mixer(mixer_bgm);
stream_bgm = al_load_audio_stream(some_file.c_str(), 2, 512);

///////////

Thank you for your time

Elias

Use al_attach_audio_stream_to_mixer, so:

al_attach_audio_stream_to_mixer(stream_bgm, mixer_bgm);

Restful Cargo

Thank you Elias

Thread #618002. Printed from Allegro.cc