Skip to content

Commit b5e0aef

Browse files
committed
AdapterPrintToAudioOutput empty constructor
1 parent e23b919 commit b5e0aef

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/AudioTools/CoreAudio/AudioIO.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,21 @@ class AudioOutputAdapter : public AudioOutput {};
230230
*/
231231
class AdapterPrintToAudioOutput : public AudioOutputAdapter {
232232
public:
233-
AdapterPrintToAudioOutput(Print &print) { p_print = &print; }
234-
void setAudioInfo(AudioInfo info) {}
233+
AdapterPrintToAudioOutput() = default;
234+
AdapterPrintToAudioOutput(Print &print) { setStream(print); }
235+
void setStream(Print& out) { p_print = &out; }
236+
void setAudioInfo(AudioInfo info) { cfg = info;}
235237
size_t write(const uint8_t *data, size_t len) {
236238
return p_print->write(data, len);
237239
}
238240
/// If true we need to release the related memory in the destructor
239241
virtual bool isDeletable() { return true; }
240242

243+
AudioInfo audioInfo() {return cfg; }
244+
241245
protected:
242246
Print *p_print = nullptr;
247+
AudioInfo cfg;
243248
};
244249

245250
/**

0 commit comments

Comments
 (0)