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

In Android if switch audio devices it will cause stopping the playback. #156

Open
xioxin opened this issue May 28, 2021 · 4 comments
Open

Comments

@xioxin
Copy link
Contributor

xioxin commented May 28, 2021

I found a possible way to run the "ma_device_init" method again.

I don't know how to get device change events via C++, so I have to trigger them manually for now.

xioxin@7d0b8de

Is there a better solution?

@meshula
Copy link
Member

meshula commented May 28, 2021

That looks like a good solution. Would you mind submitting a PR?

I suggest asking about detecting audio change events on the miniaudio issues page (https://github.com/mackron/miniaudio). We could add device change notifications to LabSound, since we already have a method for delivering notifications such as onEnded...

@xioxin
Copy link
Contributor Author

xioxin commented Jun 1, 2021

Currently AAudio does not enable automatic switching of audio devices.
I am triggering it through Java code
mackron/miniaudio#318

@mackron
Copy link

mackron commented Jan 9, 2022

I think this should be fixed upstream in the dev branch. I've not been able to test it with real hardware however, so might need some help with that part.

@meshula meshula added the v1.3 label Feb 9, 2023
@meshula
Copy link
Member

meshula commented Feb 9, 2023

I'm going to go ahead and add the reinitialize proposed in the OP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants