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

Code Example for Playing Sound in the Background #17

Open
leimao opened this issue Dec 14, 2019 · 0 comments
Open

Code Example for Playing Sound in the Background #17

leimao opened this issue Dec 14, 2019 · 0 comments
Labels
question Further information is requested

Comments

@leimao
Copy link

leimao commented Dec 14, 2019

Hello,
I wrote a simple C++ player based on alsa-lib which allows me to play wav files. I wonder if there is any convenient way to modify my code so that I can play the the wav file in the background and the main program is executing something else, say, a while loop.
Edited and Updated:
I tried to use std::thread and std::async, I was able to play the sound in the background. I looked at the header file of alsa-lib, it seems that alsa-lib natively supports playing sound asynchronously. I wonder how I could do it easily.
Thank you very much.
Best,
Lei

@perexg perexg added the question Further information is requested label Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants