I have a number of audio files on the disk (6 to be precise) each containing one instrument of a song (vocals, bass, drums etc.). The files (let’s call them tracks) have the same duration and are in the same format (.mp3).
I want to mix these audio files during playback (as in “layering” them; playing them simultaneously). This in itself is not too hard, I just convert the files to .wav and mix the pwm streams (it would be cool if there was a way to do this with mp3-files though, and not having to convert them first).
What I am unable to figure out is how to do this “dynamically”, meaning being able to, during playback, change the volume or even mute of one of the tracks. Currently I reload the audio source each time with the changes in volume, but that causes a delay each time. Any ideas on how this could be implemented without having to reload the audio source?
2