Hi all, but probably for Paul:
I've been studying the internals of play_sd_wav, and have a pretty good grasp on what it does.
However a few points are puzzling:
1. Several combinations of data rate and mono/stereo are not implemented. All the "CONVERT" ones for 22k and 11k data rates, for example.
What was the plan for implementing these? Does it involve changing the clock rate of the DAC, or was the idea to transmit the same samples twice or four times? Or perhaps interpolation?
2. Was the library intended to be able to handle WAV files that have more than one chunk of audio (ie: fmt... data ... fmt ... data)? Are such files common, and does the code succeed in such a case?
3. In the consume() code for 16-bit stereo, there are a couple of odd appearances of header[0]:
and
These appear to send a header value to the DAC, and to fetch audio data into the header variable. What is the objective here?
Illumination will be gratefully received .
I've been studying the internals of play_sd_wav, and have a pretty good grasp on what it does.
However a few points are puzzling:
1. Several combinations of data rate and mono/stereo are not implemented. All the "CONVERT" ones for 22k and 11k data rates, for example.
What was the plan for implementing these? Does it involve changing the clock rate of the DAC, or was the idea to transmit the same samples twice or four times? Or perhaps interpolation?
2. Was the library intended to be able to handle WAV files that have more than one chunk of audio (ie: fmt... data ... fmt ... data)? Are such files common, and does the code succeed in such a case?
3. In the consume() code for 16-bit stereo, there are a couple of odd appearances of header[0]:
Code:
if (leftover_bytes) {
block_left->data[block_offset] = header[0];
//PAH fix problem with left+right channels being swapped
leftover_bytes = 0;
goto right16;
and
Code:
if (size == 0) {
if (data_length == 0) break;
header[0] = (msb << 8) | lsb;
leftover_bytes = 2;
return false;
These appear to send a header value to the DAC, and to fetch audio data into the header variable. What is the objective here?
Illumination will be gratefully received .