Nana C++ Library. Reference for users.
What we need to use nana
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages

Play an audio file asynchronously. Play the audio when a button is clicked, and it does not block the UI thread.

// Please, put a test audio file in "../Examples/audio1.wav" in WAV PCM format
// you can donwload (an rename) an example from:
#include <nana/gui.hpp>
#include <nana/gui/widgets/button.hpp>
#include <nana/audio/player.hpp>
#include <nana/threads/pool.hpp>
int main()
nana::audio::player player("../Examples/audio1.wav");
nana::threads::pool pool(1); //Only 1 thread.
using namespace nana;
form fm;
button btn (fm, nana::rectangle(10, 10, 180, 24));
button btn_wait(fm, nana::rectangle(10, 40, 180, 24));
btn .caption("Play the audio");
btn_wait.caption("Play and wait 5 min !!!!");, [&]()
5, // it will wait for the entery sound to finish !! be aweare