File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1439,6 +1439,19 @@ class CallbackStream : public ModifyingStream {
14391439 // result
14401440 void setAvailableCallback (int (*cb)()) { this ->cb_available = cb; }
14411441
1442+ // / defines the callback to receive the actual audio info
1443+ void setAudioInfoCallback (void (*cb)(AudioInfo info)) {
1444+ this ->cb_audio_info = cb;
1445+ }
1446+
1447+ // / Updates the audio info and calls the callback
1448+ void setAudioInfo (AudioInfo info) override {
1449+ ModifyingStream::setAudioInfo (info);
1450+ if (cb_audio_info != nullptr ) {
1451+ cb_audio_info (info);
1452+ }
1453+ }
1454+
14421455 virtual bool begin (AudioInfo info) {
14431456 setAudioInfo (info);
14441457 return begin ();
@@ -1524,6 +1537,7 @@ class CallbackStream : public ModifyingStream {
15241537 size_t (*cb_write)(const uint8_t *data, size_t len) = nullptr ;
15251538 size_t (*cb_read)(uint8_t *data, size_t len) = nullptr ;
15261539 size_t (*cb_update)(uint8_t *data, size_t len) = nullptr ;
1540+ void (*cb_audio_info)(AudioInfo info) = nullptr ;
15271541 int (*cb_available)() = nullptr ;
15281542 Stream *p_stream = nullptr ;
15291543 Print *p_out = nullptr ;
You can’t perform that action at this time.
0 commit comments