Skip to contentSkip to conversation

Code Example for Playing Sound in the Background

alsa-devel GitHub issues - edited 1 participant 1 message Dec 14, 2019 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

alsa-project/alsa-lib issue #17 was edited from leimao:

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

Issue URL : https://github.com/alsa-project/alsa-lib/issues/17
Repository URL: https://github.com/alsa-project/alsa-lib
_______________________________________________
Alsa-devel mailing list [email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel