SDL_Mixer effects on music only

I want to add an effect to music, but not sound effects. I took a look through the documentation, but the only way I can see to add effects to music is to add effects for postmix, which means it would affect all channels. =/

So! Is there something I may have missed, or maybe a clever workaround for this? Is there a disadvantage to loading background music as a Chunk instead of a Music?

Thanks!

So to answer one of my own questions here, it appears using a Mix_Chunk for music is as possible as one would expect, but has the disadvantages of using lots of memory (Mix_Music is streamed) and having poor quality. Evidently MOD audio is still possible, which I was pleasantly surprised to learn.

So in light of these limitations in memory and quality, it would be optimal if there existed some method/workaround to apply an effect to a Mix_Music. I’ve considered trying to filter the sounds out, apply an effect and add them back in but this sounds like a nightmare and so hacky that I’d really rather exhaust other possibilities first.

So if anyone else is wondering about this, here is what I ended up doing:

I stopped using SDL_Mixer and made my own audio library on top of SDL’s built-in audio functions.

May seem kinda drastic, but it worked haha.

1 Like

you’re not the only one, welcome :wink:

One could also, as a less drastic measure, use Mix_HookMusic(). There would still be a need for interfacing with a music decoder/synth directly, but since you can directly access the stream before it hits the mixer, effects processing would be as flexible as it gets.