changes to sample rate storage

as of now we store and use the actual sample rate as opposed to an index
fo a fixed rate table.

this allows for more flexibility in a future file format...
This commit is contained in:
tildearrow 2021-12-23 18:04:44 -05:00
parent 830e880a57
commit 7ba8607270
9 changed files with 66 additions and 49 deletions

View file

@ -3,10 +3,6 @@
#include <string.h>
#include <sndfile.h>
const int sampleRates[6]={
4000, 8000, 11025, 16000, 22050, 32000
};
bool DivSample::save(const char* path) {
SNDFILE* f;
SF_INFO si;
@ -15,7 +11,7 @@ bool DivSample::save(const char* path) {
if (length<1) return false;
si.channels=1;
si.samplerate=sampleRates[rate];
si.samplerate=rate;
if (depth==16) {
si.format=SF_FORMAT_PCM_16|SF_FORMAT_WAV;
} else {