PaulStoffregen / Audio

Teensy Audio Library
http://www.pjrc.com/teensy/td_libs_Audio.html
1.08k stars 401 forks source link

memcpy_tointerleave allow AUDIO_BLOCK_SAMPLES == 4 #420

Closed ericfont closed 2 years ago

ericfont commented 2 years ago

Previous code won't work for AUDIO_BLOCK_SAMPLES < 8. So I would like to add a case for AUDIO_BLOCK_SAMPLES == 4, using the same pattern of interleaving code as for AUDIO_BLOCK_SAMPLES == 8, but just half as much.

I've tested on my Teensy 4.1 with Audio Board Rev D with L/R audio. I haven't looked into the other two functions memcpy_tointerleaveL and memcpy_tointerleaveR but I assume a similar additional case could be done for that.

ericfont commented 2 years ago

I can look into modifying memcpy_tointerleaveL and memcpy_tointerleaveR to allow AUDIO_BLOCK_SAMPLES == 4 if that is ok.

ericfont commented 2 years ago

actually now I can see how to avoid push & pop, will resubmit a PR

ericfont commented 2 years ago

closed in favor of #423, which works for L & R only as well as LR, and which also avoids push/pops.