Teensy mixing audio file and control with light sensor


I want to mix 3 audio files (play them together) with Teensy, and change the GAIN and VOLUME with two photo-resister. I already figuring out the code for changing volume with the change of light, but I don’t know how to combine this volume control code with the mixing code.

*And I really want to explore more with the light sensor, maybe add more light sensor and control on audio file separately.
Does anyone try to do more with light sensor on audio control?

(Below is the code I want to combine, mixing code and the code of playing audio file separately but with the volume control by light sensor)


sketch_mar27b_mix_together.ino (2.81 KB)

sketch_mar27a.ino (3.33 KB)