Remove 8-bit handling in output, promote WAV/FLAC to 16 (#782)
Only the WAV and FLAC generators can generate 8-bit values, so it is more efficient and sane to just have those generators upscale to 16-bit signed (if necessary) in generation and simplify all the other Generators and Outputs.
This commit is contained in:
1 parent
724b6d606e
commit
058e131b26
29 files changed
+43
-163
No files matched your search
+1
-11
@@ -42,7 +42,6 @@ AudioOutputI2S::AudioOutputI2S(int port, int output_mode, int dma_buf_count, int
|
||||
//set defaults
|
||||
mono = false;
|
||||
lsb_justified = false;
|
||||
bps = 16;
|
||||
channels = 2;
|
||||
hertz = 0; // Needs to be application-set
|
||||
bclkPin = 26;
|
||||
@@ -57,7 +56,6 @@ AudioOutputI2S::AudioOutputI2S(int port, int output_mode, int dma_buf_count, int
|
||||
AudioOutputI2S::AudioOutputI2S(long sampleRate, pin_size_t sck, pin_size_t data) {
|
||||
i2sOn = false;
|
||||
mono = false;
|
||||
bps = 16;
|
||||
channels = 2;
|
||||
hertz = sampleRate;
|
||||
bclkPin = sck;
|
||||
@@ -140,14 +138,6 @@ bool AudioOutputI2S::SetRate(int hz) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AudioOutputI2S::SetBitsPerSample(int bits) {
|
||||
if ((bits != 16) && (bits != 8)) {
|
||||
return false;
|
||||
}
|
||||
this->bps = bits;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AudioOutputI2S::SetChannels(int channels) {
|
||||
if ((channels < 1) || (channels > 2)) {
|
||||
return false;
|
||||
@@ -303,7 +293,7 @@ bool AudioOutputI2S::begin(bool txDAC) {
|
||||
if (swap_clocks) {
|
||||
i2s.swapClocks();
|
||||
}
|
||||
i2s.setBitsPerSample(bps);
|
||||
i2s.setBitsPerSample(16);
|
||||
i2s.begin(hertz);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user