#include #include "util.h" int check_sample_rate(int32_t sr) { return !(sr<1000 || sr>96000); } const char * filename_extension(const char * filename) { const char * ext; /* You know what would be nice? strrchrnul(). * Instead I have to do it myself. */ ext = strrchr(filename,'.'); if (ext==NULL) ext=filename+strlen(filename); /* point to null, i.e. an empty string for the extension */ else ext=ext+1; /* skip the dot */ return ext; } void interleave_channel(sample * outbuffer, sample * inbuffer, int32_t sample_count, int channel_count, int channel_number) { int32_t insample,outsample; if (channel_count==1) { memcpy(outbuffer,inbuffer,sizeof(sample)*sample_count); return; } for (insample=0,outsample=channel_number;insample