Skip to content

bl00mbox: faster sample loading

dx requested to merge dx/faster-samples into main

Most improvement happened in mono samples:

hihat.wav, before:  1077723 us
hihat.wav, halfway:  847702 us
hihat.wav, after:     93141 us

The halfway point above (using an int16 uctypes array) is also applicable to stereo samples:

kick.wav, before: 1402662 us
kick.wav, after:  1109889 us

Notably, using a bytearray and reading only half of the frames and setting pairs of bytes one by one from python is significantly slower, which is why this commit uses both a byterray and an int16 uctypes array.

Merge request reports

Loading