Closed philippludwig closed 2 years ago
Hi @philippludwig .
Sample is minimum discrete item of audio data. For CD Audio (16-bit) one sample is 16-bit.
Frame is block of samples of all channels.
For CD Audio frame consists of 2 samples of 16-bit (left + right).
You can also read: http://libsndfile.github.io/libsndfile/api.html#read
To convert 16-bit data to floats as required by libsamplerate API, use Auxillary Functions.
For example:
int samples = 256;
int channels = 2;
int frames = samples * channels;
int16_t *src = malloc(sizeof(int16_t) * frames);
float *input_frames = malloc(sizeof(float) * frames);
src_short_to_float_array(src, input_frames, frames);
...
Thank you for the explanation and the example. I successfully managed to upsample a block of mono wave data, but I did not use the auxiliary functions yet - I will look into those.
(I would consider this solved, so this can be closed I guess)
You're welcome!
The documentation talks about frames, e.g.
But what exactly is a "frame"? How do I put raw audio data (16bit values) into a "frame"?