in reply to C types and SV's and unpack

Based on how you do the casting, the entire buffer is of the same type. You can take advantage of that.
SV* new_sv_from_float_buffer(void* buffer, int i) { return newSVnv( (double)(((float*)buffer)[i]) ); } ... { SV* (*new_sv_from_buffer)(void*, int); if ( fmt == 3 && bps == 32 ) { new_sv_from_buffer = &new_sv_from_float_buffer; } ... ... Call new_sv_from_buffer repeatedly ... }