cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Playsound only when specific key is pres
Playsound only when specific key is pressed
Dec 21, 2017 at 7:09am UTC
sharsh2222
(1)
i am making a program in c++ but i want help in playsound fuction
i want a specific sound to be played only when a specific text is entered
for example
if i enter 'yes' or 'y'
then i want the sound to be heard after this text is entered
please help me and reply ASAP
thanking you all a lot
Dec 22, 2017 at 8:32pm UTC
noobofcpp
(18)
Use SFML.Use sf::SoundBuffer to load the sound file you what then use sf::Keyboard::isKeyPressed(sf::Keyboard::Y) to check if y is pressed then use sf::Sound to play it when you press the key.
Topic archived. No new replies allowed.