Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple inheritance error when attempting to use A2DPSource as a Stream #2746

Open
tahosa opened this issue Jan 9, 2025 · 1 comment
Open
Labels
waiting for feedback Requires response from original poster

Comments

@tahosa
Copy link

tahosa commented Jan 9, 2025

I'm attempting to use the the A2DPSource as a destination for a stream copy using the utility from arduino-audio-tools. Maybe I'm misunderstanding since it's been a long time since I've worked with C++, but StreamCopy should accept anything that derives from arduino::Print as a target. A2DPSource does appear to extend that interface, but when I try to use it, I get a compiler error that there is an ambiguous base:

error: 'arduino::Print' is an ambiguous base of 'A2DPSource'

I have added arduino-audio-tools v1.0.1 as a zip library in the Arduino IDE along with adding arduino-pico using the board manager.

Here is a simple sketch that reproduces the error:

#include <AudioTools.h>
#include <BluetoothAudio.h>

I2SStream in;
A2DPSource out;
StreamCopy copier(out, in);

void setup() {
}

void loop() {
}

Is there something I'm missing, or need to explicitly cast? I have tried to do so, but arduino::Print and arduino::Stream are both abstract classes and I'm not sure what concrete class I would need to cast to in order for this to work.

@earlephilhower
Copy link
Owner

Sorry, but I really don't know anything about that library. You may want to ping the author there and see what his suggestion is.

It's possible there's some weird C++ multiple inheritance issue here, but none of the examples in this repo are throwing errors and this is the first report like this.

@earlephilhower earlephilhower added the waiting for feedback Requires response from original poster label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Requires response from original poster
Projects
None yet
Development

No branches or pull requests

2 participants