Skip to content

Commit 0188eea

Browse files
committed
BaseConverter w/o template
1 parent 817ad32 commit 0188eea

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

examples/examples-stream/streams-adc-i2s/streams-adc-i2s.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ AudioInfo info(44100, 2, 16);
1313
AnalogAudioStream in;
1414
I2SStream out;
1515
StreamCopy copier(out, in); // copy in to out
16-
ConverterAutoCenterT<int16_t> converter;
16+
ConverterAutoCenter converter(info);
1717

1818
// Arduino Setup
1919
void setup(void) {

src/AudioHttp/AudioServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class AudioServer {
115115
if (converter_ptr==nullptr) {
116116
copier.copy();
117117
}else {
118-
copier.copy<int16_t>(*converter_ptr);
118+
copier.copy(*converter_ptr);
119119
}
120120
// if we limit the size of the WAV the encoder gets automatically closed when all has been sent
121121
if (!client_obj) {

src/AudioTools/BaseConverter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ class ConverterAutoCenter : public BaseConverter {
181181
public:
182182
ConverterAutoCenter() = default;
183183

184+
ConverterAutoCenter(AudioInfo info){
185+
begin(info.channels, info.bits_per_sample);
186+
}
187+
184188
ConverterAutoCenter(int channels, int bitsPerSample){
185189
begin(channels, bitsPerSample);
186190
}

src/AudioTools/StreamCopy.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ class StreamCopy : public StreamCopyT<uint8_t> {
352352
}
353353

354354
/// copies a buffer length of data and applies the converter
355-
template<typename T>
356355
size_t copy(BaseConverter &converter) {
357356
size_t result = available();
358357
size_t delayCount = 0;

0 commit comments

Comments
 (0)