How TO Produce animal voices.. In c++ code

Apr 3, 2013 at 5:37pm
as we know about
 
Beep(523,500);

But How it will produce animal like horse voice
Apr 3, 2013 at 5:47pm
Try mixing the infinite frequencyes and lasts of beeps ;)
Apr 3, 2013 at 6:52pm
What would you like the horse to say???
Apr 3, 2013 at 7:00pm
Hello World :)
Apr 3, 2013 at 7:00pm
You'd need a library that supports sound output.
You need to load the audio stream, and then play it.

Here's an example in SFML-2.0:
1
2
3
4
5
6
7
8
9
10
#include <SFML/Audio.hpp>

int main()
{
    sf::Music fluttershy; // Since you wanted horse sounds.
    fluttershy.openFromFile("squee.ogg");
    fluttershy.play();
    std::this_thread::sleep_for(std::chrono::seconds(3)); // Just wait for the sound to finish.
    return 0;
}


Core C++ offers no such facilities, Beep is also not part of the core language.
Topic archived. No new replies allowed.