You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 thewav
file in the background and the main program is executing something else, say, awhile
loop.Edited and Updated:
I tried to use
std::thread
andstd::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
The text was updated successfully, but these errors were encountered: